Browse Source

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>
tags/n3.0
Andreas Cadhalpun 10 years ago
parent
commit
a611375db5
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/ffmdec.c

+ 2
- 2
libavformat/ffmdec.c View File

@@ -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;
}


Loading…
Cancel
Save