[FFmpeg-cvslog] avcodec/h264_slice: Check PPS more extensively when its not copied

Michael Niedermayer git at videolan.org
Wed Apr 27 05:42:58 CEST 2016


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Fri Mar 25 15:29:26 2016 +0100| [ef54c144250af6a82f26efd6e423449064fa1505] | committer: Michael Niedermayer

avcodec/h264_slice: Check PPS more extensively when its not copied

Fixes Ticket5371
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit c50be7a52bc1e8e18a0059e489743ec12a43f257)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/h264_slice.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 63eb463..ab9f171 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 ||



More information about the ffmpeg-cvslog mailing list