mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-05 14:30:00 +01: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)) {
|
while(!avio_feof(s->pb)) {
|
||||||
get_bprint_line(s->pb, &bp);
|
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);
|
AVStream *st = avformat_new_stream(s, NULL);
|
||||||
|
|
||||||
if (!st)
|
if (!st)
|
||||||
@@ -192,7 +192,7 @@ static int read_header(AVFormatContext *s)
|
|||||||
st->codecpar->codec_id = AV_CODEC_ID_FFMETADATA;
|
st->codecpar->codec_id = AV_CODEC_ID_FFMETADATA;
|
||||||
|
|
||||||
m = &st->metadata;
|
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);
|
AVChapter *ch = read_chapter(s);
|
||||||
|
|
||||||
if (!ch)
|
if (!ch)
|
||||||
|
|||||||
Reference in New Issue
Block a user