]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rv34.c
lavc: add libdcadec decoder
[ffmpeg] / libavcodec / rv34.c
index 75f321a430cafd9f0abbb6472dc50f40488e5fa8..26ab7e4df2ec1dff8efb656eab941697030427ea 100644 (file)
@@ -1555,16 +1555,18 @@ int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecConte
             return err;
     }
 
-    if ((err = ff_mpeg_update_thread_context(dst, src)))
-        return err;
-
     r->cur_pts  = r1->cur_pts;
     r->last_pts = r1->last_pts;
     r->next_pts = r1->next_pts;
 
     memset(&r->si, 0, sizeof(r->si));
 
-    return 0;
+    // Do no call ff_mpeg_update_thread_context on a partially initialized
+    // decoder context.
+    if (!s1->linesize)
+        return 0;
+
+    return ff_mpeg_update_thread_context(dst, src);
 }
 
 static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n)
@@ -1591,7 +1593,7 @@ static int finish_frame(AVCodecContext *avctx, AVFrame *pict)
             return ret;
         ff_print_debug_info(s, s->current_picture_ptr);
         got_picture = 1;
-    } else if (s->last_picture_ptr != NULL) {
+    } else if (s->last_picture_ptr) {
         if ((ret = av_frame_ref(pict, s->last_picture_ptr->f)) < 0)
             return ret;
         ff_print_debug_info(s, s->last_picture_ptr);