Re: [FFmpeg-devel] [PATCH 1/2] avcodec/indeo2: Check remaining input more often

2019-08-13 Thread Michael Niedermayer
On Thu, Aug 01, 2019 at 02:26:22AM +0200, Michael Niedermayer wrote:
> Fixes: Timeout (95sec -> 30ms)
> Fixes: 
> 14765/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO2_fuzzer-5692455527120896
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpe
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/indeo2.c | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)

will apply patchset

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

Never trust a computer, one day, it may think you are the virus. -- Compn


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/2] avcodec/indeo2: Check remaining input more often

2019-07-31 Thread Michael Niedermayer
Fixes: Timeout (95sec -> 30ms)
Fixes: 
14765/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO2_fuzzer-5692455527120896

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

diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index 09cb560d8e..f367682e61 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -79,10 +79,11 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int 
height, uint8_t *dst
 
 for (j = 1; j < height; j++) {
 out = 0;
-if (get_bits_left(>gb) <= 0)
-return AVERROR_INVALIDDATA;
 while (out < width) {
-int c = ir2_get_code(>gb);
+int c;
+if (get_bits_left(>gb) <= 0)
+return AVERROR_INVALIDDATA;
+c = ir2_get_code(>gb);
 if (c >= 0x80) { /* we have a skip */
 c -= 0x7F;
 if (out + c*2 > width)
@@ -123,9 +124,9 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int 
width, int height, uint8_
 
 for (j = 0; j < height; j++) {
 out = 0;
-if (get_bits_left(>gb) <= 0)
-return AVERROR_INVALIDDATA;
 while (out < width) {
+if (get_bits_left(>gb) <= 0)
+return AVERROR_INVALIDDATA;
 c = ir2_get_code(>gb);
 if (c >= 0x80) { /* we have a skip */
 c   -= 0x7F;
-- 
2.22.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".