aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-03-25 15:29:26 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-03-29 03:25:15 +0200
commit26d29f0c3dc200bbbf066f55a90738398b6013be (patch)
tree7365a9b9a0ee7b94e9b91d61295cdfccce8e55f9
parent7b1e020fc5edbc09774d6fe7857d47d29f157a13 (diff)
downloadffmpeg-26d29f0c3dc200bbbf066f55a90738398b6013be.tar.gz
avcodec/h264_slice: Check PPS more extensively when its not copied
Fixes Ticket5371 Fixes null pointer dereference Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit c50be7a52bc1e8e18a0059e489743ec12a43f257) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/h264_slice.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 2131338a7b..0b3e0406f2 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1282,9 +1282,13 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
if (first_slice) {
h->pps = *h->pps_buffers[pps_id];
- } else if (h->setup_finished && h->dequant_coeff_pps != pps_id) {
- av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
- return AVERROR_INVALIDDATA;
+ } else {
+ if (h->pps.sps_id != pps->sps_id ||
+ h->pps.transform_8x8_mode != pps->transform_8x8_mode ||
+ (h->setup_finished && h->dequant_coeff_pps != pps_id)) {
+ av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
+ return AVERROR_INVALIDDATA;
+ }
}
if (pps->sps_id != h->sps.sps_id ||