[FFmpeg-cvslog] mdec.c: fix overread.

Ronald S. Bultje git at videolan.org
Thu May 19 06:02:19 CEST 2011


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Tue May 10 11:29:08 2011 -0400| [32ac63ee10ca5daa149344a75d736c1b98177392] | committer: Ronald S. Bultje

mdec.c: fix overread.

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

 libavcodec/mdec.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 545b919..9b6e6b6 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -125,7 +125,8 @@ static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){
     a->dsp.clear_blocks(block[0]);
 
     for(i=0; i<6; i++){
-        if( mdec_decode_block_intra(a, block[ block_index[i] ], block_index[i]) < 0)
+        if( mdec_decode_block_intra(a, block[ block_index[i] ], block_index[i]) < 0 ||
+            get_bits_left(&a->gb) < 0)
             return -1;
     }
     return 0;



More information about the ffmpeg-cvslog mailing list