avcodec/pngdec: mark previous_picture as done on end of decode_frame_common()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 28 Sep 2015 00:42:39 +0000 (02:42 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 30 Sep 2015 23:11:45 +0000 (01:11 +0200)
Fixes deadlock with threads

Found-by: Paul B Mahol
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pngdec.c

index 1b47b18..bd84ee9 100644 (file)
@@ -1217,6 +1217,7 @@ exit_loop:
         }
     }
     ff_thread_report_progress(&s->picture, INT_MAX, 0);
+    ff_thread_report_progress(&s->previous_picture, INT_MAX, 0);
 
     av_frame_set_metadata(p, metadata);
     metadata   = NULL;
@@ -1225,6 +1226,7 @@ exit_loop:
 fail:
     av_dict_free(&metadata);
     ff_thread_report_progress(&s->picture, INT_MAX, 0);
+    ff_thread_report_progress(&s->previous_picture, INT_MAX, 0);
     return ret;
 }