Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-03 00:47:12 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-04 17:20:04 +0300
commita611375db532c3d5363d97b10fadd0211811a4fd (patch)
tree3620bc8ae4a74ba64e74ea78f68e394727e77c47 /libavformat/ffmdec.c
parent488e9a06f014222720deafc48f43d9bd1973ba97 (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 <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/ffmdec.c')
-rw-r--r--libavformat/ffmdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 9ad771ea38..afba9050cb 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -423,7 +423,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;
}
@@ -438,7 +438,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;
}