[FFmpeg-devel] [PATCH] avcodec/jpeg2000dec: make SOC finding code more robust

Paul B Mahol onemda at gmail.com
Tue Jul 23 13:35:37 CEST 2013


On 7/23/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> Fixes file from Ticket860
>
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavcodec/jpeg2000dec.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
> index c6f6f6c..d59fb5f 100644
> --- a/libavcodec/jpeg2000dec.c
> +++ b/libavcodec/jpeg2000dec.c
> @@ -1623,6 +1623,9 @@ static int jpeg2000_decode_frame(AVCodecContext
> *avctx, void *data,
>          bytestream2_seek(&s->g, 0, SEEK_SET);
>      }
>
> +    while(bytestream2_get_bytes_left(&s->g) >= 3 &&
> bytestream2_peek_be16(&s->g) != JPEG2000_SOC)

Please follow style of rest of file. space between 'while' and '('

> +        bytestream2_skip(&s->g, 1);
> +
>      if (bytestream2_get_be16u(&s->g) != JPEG2000_SOC) {
>          av_log(avctx, AV_LOG_ERROR, "SOC marker not present\n");
>          ret = AVERROR_INVALIDDATA;
> --
> 1.7.9.5
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list