h264: Use the right H264Context for struct member comparison
authorDiego Biurrun <diego@biurrun.de>
Mon, 9 Jan 2017 16:22:08 +0000 (17:22 +0100)
committerDiego Biurrun <diego@biurrun.de>
Mon, 9 Jan 2017 16:22:08 +0000 (17:22 +0100)
Fixes crashes with slice threading.

libavcodec/h264.c

index 2f54508..ea6845a 100644 (file)
@@ -2796,8 +2796,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
     if (s->context_initialized
         && (   s->width != s->avctx->width || s->height != s->avctx->height
             || av_cmp_q(h->sps.sar, s->avctx->sample_aspect_ratio) ||
-            h->chroma_format_idc != h->sps.chroma_format_idc ||
-            h->bit_depth         != h->sps.bit_depth_luma)) {
+            h0->chroma_format_idc != h->sps.chroma_format_idc ||
+            h0->bit_depth         != h->sps.bit_depth_luma)) {
         if(h != h0 || (HAVE_THREADS && h->s.avctx->active_thread_type & FF_THREAD_FRAME)) {
             av_log_missing_feature(s->avctx, "Width/height changing with threads is", 0);
             return AVERROR_PATCHWELCOME;   // width / height changed during parallelized decoding