You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-05-16 08:38:24 +02:00
ffmdec: reject zero-sized chunks
If size is zero, avio_get_str fails, leaving the buffer uninitialized.
This causes invalid reads in av_set_options_string.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit a611375db5)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
@@ -415,7 +415,7 @@ static int ffm2_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MKBETAG('S', '2', 'V', 'I'):
|
case MKBETAG('S', '2', 'V', 'I'):
|
||||||
if (f_stvi++) {
|
if (f_stvi++ || !size) {
|
||||||
ret = AVERROR(EINVAL);
|
ret = AVERROR(EINVAL);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@@ -430,7 +430,7 @@ static int ffm2_read_header(AVFormatContext *s)
|
|||||||
goto fail;
|
goto fail;
|
||||||
break;
|
break;
|
||||||
case MKBETAG('S', '2', 'A', 'U'):
|
case MKBETAG('S', '2', 'A', 'U'):
|
||||||
if (f_stau++) {
|
if (f_stau++ || !size) {
|
||||||
ret = AVERROR(EINVAL);
|
ret = AVERROR(EINVAL);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user