[FFmpeg-cvslog] avcodec/dvdec: dont try to decode ac when theres no input

Michael Niedermayer git at videolan.org
Mon Oct 28 23:55:44 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Oct 28 22:55:53 2013 +0100| [f0b26bf0f56e3e727e62be1b63d6fc087b319443] | committer: Michael Niedermayer

avcodec/dvdec: dont try to decode ac when theres no input

fixes reading out of an empty bitstream

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f0b26bf0f56e3e727e62be1b63d6fc087b319443
---

 libavcodec/dvdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
index b86926a..c46c2ff 100644
--- a/libavcodec/dvdec.c
+++ b/libavcodec/dvdec.c
@@ -237,7 +237,7 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
     flush_put_bits(&vs_pb);
     for (mb_index = 0; mb_index < 5; mb_index++) {
         for (j = 0; j < s->sys->bpm; j++) {
-            if (mb->pos < 64) {
+            if (mb->pos < 64 && get_bits_left(&gb) > 0) {
                 av_dlog(avctx, "start %d:%d\n", mb_index, j);
                 dv_decode_ac(&gb, mb, block);
             }



More information about the ffmpeg-cvslog mailing list