changeset 2883:a95e55679dfa libavcodec

check return value of decode_cabac_mb_dqp, it is INT_MIN on error. fixes crash with http://stud4.tuwien.ac.at/~e0326863/ats/bbc-sample_small.mpg and MPlayer's broken packetizer (but will not decode right of course).
author reimar
date Sat, 17 Sep 2005 08:15:07 +0000
parents dd5a1abbf9a3
children a332778dfa06
files h264.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Wed Sep 14 21:05:24 2005 +0000
+++ b/h264.c	Sat Sep 17 08:15:07 2005 +0000
@@ -6044,6 +6044,10 @@
         }
 
         h->last_qscale_diff = dqp = decode_cabac_mb_dqp( h );
+        if( dqp == INT_MIN ){
+            av_log(h->s.avctx, AV_LOG_ERROR, "cabac decode of qscale diff failed at %d %d\n", s->mb_x, s->mb_y);
+            return -1;
+        }
         s->qscale += dqp;
         if(((unsigned)s->qscale) > 51){
             if(s->qscale<0) s->qscale+= 52;