[FFmpeg-devel,1/2] avcodec/dstdec: Check read_table() for failure

Submitted by Michael Niedermayer on Oct. 15, 2019, 11:05 p.m.

Details

Message ID 20191015230545.21899-1-michael@niedermayer.cc
State Accepted
Commit 03ea8d8cd45e55eeb9675c38184dc2149710a557
Headers show

Commit Message

Michael Niedermayer Oct. 15, 2019, 11:05 p.m.
Fixes: Timeout (too long -> 42sec)
Fixes: 18181/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5736646250594304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/dstdec.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer Nov. 9, 2019, 2:59 p.m.
On Wed, Oct 16, 2019 at 01:05:44AM +0200, Michael Niedermayer wrote:
> Fixes: Timeout (too long -> 42sec)
> Fixes: 18181/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5736646250594304
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/dstdec.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

will apply patchset

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c
index 48271b10f7..e0519d2a0b 100644
--- a/libavcodec/dstdec.c
+++ b/libavcodec/dstdec.c
@@ -302,11 +302,15 @@  static int decode_frame(AVCodecContext *avctx, void *data,
 
     /* Filter Coef Sets (10.12) */
 
-    read_table(gb, &s->fsets, fsets_code_pred_coeff, 7, 9, 1, 0);
+    ret = read_table(gb, &s->fsets, fsets_code_pred_coeff, 7, 9, 1, 0);
+    if (ret < 0)
+        return ret;
 
     /* Probability Tables (10.13) */
 
-    read_table(gb, &s->probs, probs_code_pred_coeff, 6, 7, 0, 1);
+    ret = read_table(gb, &s->probs, probs_code_pred_coeff, 6, 7, 0, 1);
+    if (ret < 0)
+        return ret;
 
     /* Arithmetic Coded Data (10.11) */