You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user