diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-07 20:56:20 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-16 13:28:52 +0200 |
commit | 7eae8cd87054713cbef51b22b93f3a0eb5036c90 (patch) | |
tree | 892b1c7d5f2f7f77a60fb6379c683f2a25be4bc5 /libavcodec/h264_slice.c | |
parent | 9025072e6c25ffd4507f0268b53743f9c4d52cd6 (diff) | |
download | ffmpeg-7eae8cd87054713cbef51b22b93f3a0eb5036c90.tar.gz |
avcodec/h264: fix frame skip code
Fixes Ticket3475
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r-- | libavcodec/h264_slice.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 51120531df..13b1da7abc 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1321,6 +1321,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0) return AVERROR_INVALIDDATA; } + if ( + (h->avctx->skip_frame >= AVDISCARD_NONREF && !h->nal_ref_idc) || + (h->avctx->skip_frame >= AVDISCARD_BIDIR && h->slice_type_nos == AV_PICTURE_TYPE_B) || + (h->avctx->skip_frame >= AVDISCARD_NONINTRA && h->slice_type_nos != AV_PICTURE_TYPE_I) || + (h->avctx->skip_frame >= AVDISCARD_NONKEY && h->nal_unit_type != NAL_IDR_SLICE) || + h->avctx->skip_frame >= AVDISCARD_ALL) { + return SLICE_SKIPED; + } + // to make a few old functions happy, it's wrong though h->pict_type = h->slice_type; |