[FFmpeg-devel] [PATCH] libavformat/flac_picture: Don't return AVERROR_INVALIDDATA for errors with flac picture mimetype

Will Cassella cassew at chromium.org
Sat Sep 10 01:44:12 EEST 2022


In the case where the FLAC picture MIME type is not understood, fail to
parse the picture silently rather than return AVERROR_INVALIDDATA.

This originated from a bug reported in Chromium: https://crbug.com/1052821

Signed-off-by: Will Cassella <cassew at google.com>
---
 libavformat/flac_picture.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c
index b33fee75b4..1acad9b251 100644
--- a/libavformat/flac_picture.c
+++ b/libavformat/flac_picture.c
@@ -68,8 +68,6 @@ int ff_flac_parse_picture(AVFormatContext *s,
uint8_t **bufp, int buf_size,
     if (len <= 0 || len >= sizeof(mimetype)) {
         av_log(s, AV_LOG_ERROR, "Could not read mimetype from an attached "
                "picture.\n");
-        if (s->error_recognition & AV_EF_EXPLODE)
-            return AVERROR_INVALIDDATA;
         return 0;
     }
     if (len + 24 > bytestream2_get_bytes_left(&g)) {
@@ -91,8 +89,6 @@ int ff_flac_parse_picture(AVFormatContext *s,
uint8_t **bufp, int buf_size,
     if (id == AV_CODEC_ID_NONE) {
         av_log(s, AV_LOG_ERROR, "Unknown attached picture mimetype: %s.\n",
                mimetype);
-        if (s->error_recognition & AV_EF_EXPLODE)
-            return AVERROR_INVALIDDATA;
         return 0;
     }

-- 
2.37.2.789.g6183377224-goog


More information about the ffmpeg-devel mailing list