[FFmpeg-cvslog] diracdec: fix empty data units.
Michael Niedermayer
git at videolan.org
Mon Nov 14 18:17:08 CET 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov 14 18:01:13 2011 +0100| [6718536ba500d8a471bae3849f124da892936c70] | committer: Michael Niedermayer
diracdec: fix empty data units.
Fixed Ticket636
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6718536ba500d8a471bae3849f124da892936c70
---
libavcodec/diracdec.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index db2cb0f..1ace7bd 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);
More information about the ffmpeg-cvslog
mailing list