summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <[email protected]>2015-12-02 22:47:12 +0100
committerAndreas Cadhalpun <[email protected]>2015-12-17 21:37:10 +0100
commite1b38b36853b67428447c1ea483bd27db7534e15 (patch)
tree9f50baf3ab8c2b5616d1cca97488421e0697bdc0
parent26e98f9ae54e0c519d8d3ea233b7ecea9c4b66ea (diff)
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 <[email protected]> Signed-off-by: Andreas Cadhalpun <[email protected]> (cherry picked from commit a611375db532c3d5363d97b10fadd0211811a4fd) Signed-off-by: Andreas Cadhalpun <[email protected]>
-rw-r--r--libavformat/ffmdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 57df43b912..87cf546fbc 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -414,7 +414,7 @@ static int ffm2_read_header(AVFormatContext *s)
}
break;
case MKBETAG('S', '2', 'V', 'I'):
- if (f_stvi++) {
+ if (f_stvi++ || !size) {
ret = AVERROR(EINVAL);
goto fail;
}
@@ -429,7 +429,7 @@ static int ffm2_read_header(AVFormatContext *s)
goto fail;
break;
case MKBETAG('S', '2', 'A', 'U'):
- if (f_stau++) {
+ if (f_stau++ || !size) {
ret = AVERROR(EINVAL);
goto fail;
}