]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264.c
Merge commit '8136f234445862c94d1c081606b2d1e3d44fccf3'
[ffmpeg] / libavcodec / h264.c
index 3d759cc4f6793056b9f136918356b1769f44de49..34cd8c06583ca2253994cc0a927b9abb48cd11ea 100644 (file)
@@ -2367,7 +2367,7 @@ static int field_end(H264Context *h, int in_setup)
      * past end by one (callers fault) and resync_mb_y != 0
      * causes problems for the first MB line, too.
      */
-    if (!FIELD_PICTURE && h->current_slice)
+    if (!FIELD_PICTURE && h->current_slice && !h->sps.new)
         ff_er_frame_end(s);
 
     ff_MPV_frame_end(s);
@@ -3906,6 +3906,7 @@ static int execute_decode_slices(H264Context *h, int context_count)
     if (context_count == 1) {
         return decode_slice(avctx, &h);
     } else {
+        av_assert0(context_count > 0);
         for (i = 1; i < context_count; i++) {
             hx                    = h->thread_context[i];
             hx->s.err_recognition = avctx->err_recognition;