summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/image_writer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/image_writer.c b/video/image_writer.c
index c8cde77304..1bdf4163a0 100644
--- a/video/image_writer.c
+++ b/video/image_writer.c
@@ -371,6 +371,11 @@ static bool write_avif(struct image_writer_ctx *ctx, mp_image_t *image,
avctx->pkt_timebase = (AVRational){1, 30};
avctx->codec_type = AVMEDIA_TYPE_VIDEO;
avctx->pix_fmt = imgfmt2pixfmt(image->imgfmt);
+ if (avctx->pix_fmt == AV_PIX_FMT_NONE) {
+ MP_ERR(ctx, "Image format %s not supported by lavc.\n",
+ mp_imgfmt_to_name(image->imgfmt));
+ goto free_data;
+ }
av_opt_set_int(avctx, "still-picture", 1, AV_OPT_SEARCH_CHILDREN);