aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-12-13 20:12:52 +0100
committerPaul B Mahol <onemda@gmail.com>2018-12-14 11:32:27 +0100
commite9817636a7e132129fee0c34e05f224da14c5200 (patch)
tree442ba142175c69c648619b862bdb3afe7ecb910d
parent6f058b5cef67ffdb45f1d99553537efa9d3c1c1a (diff)
downloadffmpeg-e9817636a7e132129fee0c34e05f224da14c5200.tar.gz
avformat/flac_picture: try to guess PNG by actual picture data
Fixes #5028.
-rw-r--r--libavformat/flac_picture.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c
index 38982b960d..8317ab2fa6 100644
--- a/libavformat/flac_picture.c
+++ b/libavformat/flac_picture.c
@@ -20,6 +20,8 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/intreadwrite.h"
+#include "libavcodec/png.h"
#include "avformat.h"
#include "flac_picture.h"
#include "id3v2.h"
@@ -119,6 +121,9 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
goto fail;
}
+ if (AV_RB64(data->data) == PNGSIG)
+ id = AV_CODEC_ID_PNG;
+
st = avformat_new_stream(s, NULL);
if (!st) {
RETURN_ERROR(AVERROR(ENOMEM));