]> git.sesse.net Git - ffmpeg/commitdiff
h264: allow disabling bitstream overread protection by using the fast flag.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 14 Sep 2011 18:48:00 +0000 (20:48 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 14 Sep 2011 18:48:00 +0000 (20:48 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h264.c

index c656189b3d076616d94d03ba22be750a3083425b..3b24b6ac55d38994556f1e1a60753088866075d1 100644 (file)
@@ -188,8 +188,12 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_l
     if(i>=length-1){ //no escaped 0
         *dst_length= length;
         *consumed= length+1; //+1 for the header
-        memcpy(dst, src, length);
-        return dst;
+        if(h->s.avctx->flags2 & CODEC_FLAG2_FAST){
+            return src;
+        }else{
+            memcpy(dst, src, length);
+            return dst;
+        }
     }
 
 //printf("decoding esc\n");