[FFmpeg-cvslog] h264: allow disabling bitstream overread protection by using the fast flag.

Michael Niedermayer git at videolan.org
Wed Sep 21 21:08:37 CEST 2011


ffmpeg | branch: release/0.8 | Michael Niedermayer <michaelni at gmx.at> | Wed Sep 14 20:48:00 2011 +0200| [fa3f7391be8536ecdf5d8547c0162c68b206043f] | committer: Michael Niedermayer

h264: allow disabling bitstream overread protection by using the fast flag.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 205c13685f36a17f406b7cd07e14b6d2a61f396a)

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

 libavcodec/h264.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 12bed3a..5841b1f 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -197,8 +197,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");



More information about the ffmpeg-cvslog mailing list