summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/image_writer.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/video/image_writer.c b/video/image_writer.c
index ec5f578e2b..6fc933e34d 100644
--- a/video/image_writer.c
+++ b/video/image_writer.c
@@ -160,9 +160,7 @@ static bool write_lavc(struct image_writer_ctx *ctx, mp_image_t *image, FILE *fp
success = !!got_output;
error_exit:
- if (avctx)
- avcodec_close(avctx);
- av_free(avctx);
+ avcodec_free_context(&avctx);
av_frame_free(&pic);
av_packet_unref(&pkt);
return success;