diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-05-20 12:30:42 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-06-21 11:20:26 +0200 |
commit | e26c64148be8a20ace7512d96503172fb5e9753b (patch) | |
tree | 57cfa88685fd2b448e462ba42ee515810e9c0f8e /libavcodec/h264_slice.c | |
parent | 6efc4638584e1e14d1a6152186ba28f5d48a80c0 (diff) | |
download | ffmpeg-streaming-e26c64148be8a20ace7512d96503172fb5e9753b.zip ffmpeg-streaming-e26c64148be8a20ace7512d96503172fb5e9753b.tar.gz |
h264: discard slices of redundant pictures right after parsing the slice header
Going through the whole decoder initialization process for a slice we
are not going to decode is unnecessary and potentially dangerous.
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r-- | libavcodec/h264_slice.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index dbff1f3..4910396 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1565,6 +1565,10 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl, if (ret < 0) return ret; + // discard redundant pictures + if (sl->redundant_pic_count > 0) + return 0; + if (!h->setup_finished) { if (sl->first_mb_addr == 0) { // FIXME better field boundary detection if (h->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) { |