[FFmpeg-devel] [FFmpeg-cvslog] avformat/flac_picture: try to guess PNG by actual picture data
Carl Eugen Hoyos
ceffmpeg at gmail.com
Fri Dec 14 17:40:48 EET 2018
2018-12-14 11:36 GMT+01:00, Paul B Mahol <git at videolan.org>:
> ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Dec 13
> 20:12:52 2018 +0100| [e9817636a7e132129fee0c34e05f224da14c5200] | committer:
> Paul B Mahol
>
> avformat/flac_picture: try to guess PNG by actual picture data
>
> Fixes #5028.
>
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e9817636a7e132129fee0c34e05f224da14c5200
> ---
>
> libavformat/flac_picture.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> 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;
> +
Is it still useful that the function fails above if
the mimetype is unknown?
And shouldn't this use the probe function to
detect jpeg with wrong mime type?
Carl Eugen
More information about the ffmpeg-devel
mailing list