avformat/ffmetadec: don't compare undefined string
Fixes use-of-uninitialized-value when bp.len == 0. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
parent
efeddd1b8b
commit
96ab006566
1 changed files with 2 additions and 2 deletions
|
|
@ -182,7 +182,7 @@ static int read_header(AVFormatContext *s)
|
|||
while(!avio_feof(s->pb)) {
|
||||
get_bprint_line(s->pb, &bp);
|
||||
|
||||
if (!memcmp(bp.str, ID_STREAM, strlen(ID_STREAM))) {
|
||||
if (bp.len == strlen(ID_STREAM) && !memcmp(bp.str, ID_STREAM, strlen(ID_STREAM))) {
|
||||
AVStream *st = avformat_new_stream(s, NULL);
|
||||
|
||||
if (!st)
|
||||
|
|
@ -192,7 +192,7 @@ static int read_header(AVFormatContext *s)
|
|||
st->codecpar->codec_id = AV_CODEC_ID_FFMETADATA;
|
||||
|
||||
m = &st->metadata;
|
||||
} else if (!memcmp(bp.str, ID_CHAPTER, strlen(ID_CHAPTER))) {
|
||||
} else if (bp.len == strlen(ID_CHAPTER) && !memcmp(bp.str, ID_CHAPTER, strlen(ID_CHAPTER))) {
|
||||
AVChapter *ch = read_chapter(s);
|
||||
|
||||
if (!ch)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue