[FFmpeg-devel] [PATCH]lavf/img2dec: Return a low score for mjpeg when probing jpeg_pipe

Michael Niedermayer michael at niedermayer.cc
Fri Dec 11 00:58:47 EET 2020


On Wed, Dec 09, 2020 at 11:43:49PM +0100, Carl Eugen Hoyos wrote:
> Am Mi., 9. Dez. 2020 um 23:38 Uhr schrieb Carl Eugen Hoyos <ceffmpeg at gmail.com>:
> 
> > Attached patch fixes ticket #9026.
> 
> Alternative patch attached.
> 
> Carl Eugen

>  rawdec.c |    2 ++
>  1 file changed, 2 insertions(+)
> e23a6c24d563b05c5f5e7bb333dc882bf2bdc33a  0001-lavf-rawdec-Return-a-low-score-if-the-mjpeg-probe-fu.patch
> From eff71dca7111042cf696f47267ba311a5565629f Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
> Date: Wed, 9 Dec 2020 23:42:33 +0100
> Subject: [PATCH] lavf/rawdec: Return a low score if the mjpeg probe function
>  detected one frame.
> 
> Fixes ticket #9026.
> ---
>  libavformat/rawdec.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
> index 10c37c5cb9..122afca1b6 100644
> --- a/libavformat/rawdec.c
> +++ b/libavformat/rawdec.c
> @@ -208,6 +208,8 @@ static int mjpeg_probe(const AVProbeData *p)
>              return AVPROBE_SCORE_EXTENSION / 2;
>          return AVPROBE_SCORE_EXTENSION / 4;
>      }
> +    if (!nb_invalid && nb_frames)
> +        return AVPROBE_SCORE_EXTENSION / 4;
>  

returnung a non zero score here seems reasonable

thx


>      return 0;

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Nations do behave wisely once they have exhausted all other alternatives. 
-- Abba Eban
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20201210/7095cfe7/attachment.sig>


More information about the ffmpeg-devel mailing list