Browse Source

avformat/flac_picture: try to guess PNG by actual picture data

Fixes #5028.
tags/n4.2
Paul B Mahol 6 years ago
parent
commit
e9817636a7
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/flac_picture.c

+ 5
- 0
libavformat/flac_picture.c View File

@@ -20,6 +20,8 @@
*/ */


#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "libavcodec/png.h"
#include "avformat.h" #include "avformat.h"
#include "flac_picture.h" #include "flac_picture.h"
#include "id3v2.h" #include "id3v2.h"
@@ -119,6 +121,9 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
goto fail; goto fail;
} }


if (AV_RB64(data->data) == PNGSIG)
id = AV_CODEC_ID_PNG;

st = avformat_new_stream(s, NULL); st = avformat_new_stream(s, NULL);
if (!st) { if (!st) {
RETURN_ERROR(AVERROR(ENOMEM)); RETURN_ERROR(AVERROR(ENOMEM));


Loading…
Cancel
Save