diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-14 18:01:13 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-14 18:14:20 +0100 |
commit | 6718536ba500d8a471bae3849f124da892936c70 (patch) | |
tree | 0fe6cb69edf2a81f7b5783e2fc89fd131ba2374c /libavcodec/diracdec.c | |
parent | 07c7ffc04b5f16e73bd6d8439580683d01e0334d (diff) | |
download | ffmpeg-6718536ba500d8a471bae3849f124da892936c70.tar.gz |
diracdec: fix empty data units.
Fixed Ticket636
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r-- | libavcodec/diracdec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index db2cb0fba8..1ace7bd425 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1836,7 +1836,8 @@ static int dirac_decode_frame(AVCodecContext *avctx, void *data, int *data_size, break; data_unit_size = AV_RB32(buf+buf_idx+5); - if (buf_idx + data_unit_size > buf_size) { + if (buf_idx + data_unit_size > buf_size || !data_unit_size) { + if(buf_idx + data_unit_size > buf_size) av_log(s->avctx, AV_LOG_ERROR, "Data unit with size %d is larger than input buffer, discarding\n", data_unit_size); |