diff --git a/libavformat/mov.c b/libavformat/mov.c index 870cb9703e..910df844dc 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -11683,9 +11683,12 @@ static int mov_parse_heif_layered_video_tmap(AVFormatContext *s, const HEIFGroup err = av_gain_map_params_from_iso21496(gain, payload, tmap->item->extent_length - 1); av_freep(&payload); - if (err < 0) + if (err < 0) { + av_log(s, AV_LOG_ERROR, "Invalid ISO 21496-1 gain map payload\n"); + ff_remove_stream_group(s, stg); + err = (s->error_recognition & (AV_EF_COMPLIANT|AV_EF_EXPLODE)) ? AVERROR_INVALIDDATA : 0; goto fail; - + } for (int j = 0; j < tmap->nb_items; j++) { HEIFItem *item = tmap->item_list[j]; AVPacketSideData *sd;