--- libavformat/flac_picture.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c index 53e24b28b7..3e684b58a3 100644 --- a/libavformat/flac_picture.c +++ b/libavformat/flac_picture.c @@ -31,7 +31,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size, int truncate_workaround) { - const CodecMime *mime = ff_id3v2_mime_tags; + const AVCodecDescriptor *cdesc; enum AVCodecID id = AV_CODEC_ID_NONE; AVBufferRef *data = NULL; uint8_t mimetype[64], *desc = NULL; @@ -78,13 +78,8 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size, int tr bytestream2_get_bufferu(&g, mimetype, len); mimetype[len] = 0; - while (mime->id != AV_CODEC_ID_NONE) { - if (!strncmp(mime->str, mimetype, sizeof(mimetype))) { - id = mime->id; - break; - } - mime++; - } + if ((cdesc = avcodec_descriptor_get_by_mime_type(mimetype, "image"))) + id = cdesc->id; if (id == AV_CODEC_ID_NONE) { av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n", mimetype); -- 2.27.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".