aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-14 20:48:00 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-14 20:48:00 +0200
commit205c13685f36a17f406b7cd07e14b6d2a61f396a (patch)
tree4a8f13faf4eb7a5a827325fcae12d6232d4bc125 /libavcodec/h264.c
parentcdced09ef6e40212bc69486c6d314a7f48e5647d (diff)
downloadffmpeg-205c13685f36a17f406b7cd07e14b6d2a61f396a.tar.gz
h264: allow disabling bitstream overread protection by using the fast flag.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index c656189b3d..3b24b6ac55 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -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");