Re: [FFmpeg-devel] [PATCH] avcodec/jvdec: Check available input space before decode8x8()

2019-02-23 Thread Michael Niedermayer
On Thu, Feb 21, 2019 at 12:13:50PM +0100, Paul B Mahol wrote:
> On 2/21/19, Michael Niedermayer  wrote:
> > Fixes: Timeout (78 sec -> 15 millisec)
> > Fixes:
> > 13147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JV_fuzzer-5727107827630080
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/jvdec.c | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
> > index cbe83d3c10..bf8a55cbad 100644
> > --- a/libavcodec/jvdec.c
> > +++ b/libavcodec/jvdec.c
> > @@ -170,6 +170,11 @@ static int decode_frame(AVCodecContext *avctx, void
> > *data, int *got_frame,
> >  GetBitContext gb;
> >  init_get_bits(, buf, 8 * video_size);
> >
> > +if ( avctx->height/8 * (avctx->width/8) > 4 * video_size) {
> > +av_log(avctx, AV_LOG_ERROR, "Insuffient input data for
> > dimensions\n");
> 
> Typo

will apply without the typo

thanks


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/jvdec: Check available input space before decode8x8()

2019-02-21 Thread Paul B Mahol
On 2/21/19, Michael Niedermayer  wrote:
> Fixes: Timeout (78 sec -> 15 millisec)
> Fixes:
> 13147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JV_fuzzer-5727107827630080
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/jvdec.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
> index cbe83d3c10..bf8a55cbad 100644
> --- a/libavcodec/jvdec.c
> +++ b/libavcodec/jvdec.c
> @@ -170,6 +170,11 @@ static int decode_frame(AVCodecContext *avctx, void
> *data, int *got_frame,
>  GetBitContext gb;
>  init_get_bits(, buf, 8 * video_size);
>
> +if ( avctx->height/8 * (avctx->width/8) > 4 * video_size) {
> +av_log(avctx, AV_LOG_ERROR, "Insuffient input data for
> dimensions\n");

Typo

> +return AVERROR_INVALIDDATA;
> +}
> +
>  for (j = 0; j < avctx->height; j += 8)
>  for (i = 0; i < avctx->width; i += 8)
>  decode8x8(,
> --
> 2.20.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/jvdec: Check available input space before decode8x8()

2019-02-21 Thread Michael Niedermayer
Fixes: Timeout (78 sec -> 15 millisec)
Fixes: 
13147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JV_fuzzer-5727107827630080

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/jvdec.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
index cbe83d3c10..bf8a55cbad 100644
--- a/libavcodec/jvdec.c
+++ b/libavcodec/jvdec.c
@@ -170,6 +170,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 GetBitContext gb;
 init_get_bits(, buf, 8 * video_size);
 
+if ( avctx->height/8 * (avctx->width/8) > 4 * video_size) {
+av_log(avctx, AV_LOG_ERROR, "Insuffient input data for 
dimensions\n");
+return AVERROR_INVALIDDATA;
+}
+
 for (j = 0; j < avctx->height; j += 8)
 for (i = 0; i < avctx->width; i += 8)
 decode8x8(,
-- 
2.20.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel