[FFmpeg-devel] [PATCH]lavc/mjpegdec: Read polarity field from AVI1 chunk

Michael Niedermayer michael at niedermayer.cc
Sun May 15 04:22:01 CEST 2016


On Mon, May 09, 2016 at 02:44:23PM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached aptch fixes ticket #5523 for me, I only tested the files
> attached there.
> 
> Please comment, Carl Eugen

>  mjpegdec.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> e8ca5feb642e2a59d0d27bd31ff637253123fa34  0001-lavc-mjpegdec-Read-polarity-field-from-AVI1-chunk.patch
> From 389009e064e9e2b4a1a35d1add0efe1b643c1a62 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <cehoyos at ag.or.at>
> Date: Mon, 9 May 2016 14:40:22 +0200
> Subject: [PATCH] lavc/mjpegdec: Read polarity field from AVI1 chunk.
> 
> Fixes ticket #5523.
> ---
>  libavcodec/mjpegdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index 7d38fc2..74884f1 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -1655,7 +1655,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
>              4bytes      field_size_less_padding
>          */
>              s->buggy_avid = 1;
> -        i = get_bits(&s->gb, 8); len--;
> +        s->interlace_polarity = get_bits(&s->gb, 8); len--;

this could set interlace_polarity  to values outside 0-1

[...]


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160515/53df6479/attachment.sig>


More information about the ffmpeg-devel mailing list