diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-01-09 01:29:38 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-01-16 03:29:18 +0300 |
commit | 6ed3d0e01c20aba7ef3984c0b8965d26e9f4990c (patch) | |
tree | 41d3e9b939990155390d3202d55bee658d716ac9 /libavcodec/dirac_arith.h | |
parent | 6dde65d7c0ac34ad1aa2619ec7d979cb6464f9af (diff) |
avcodec/diracdec: Propagate errors from dirac_get_arith_uint()
Testcase: 11663/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dirac_arith.h')
-rw-r--r-- | libavcodec/dirac_arith.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/dirac_arith.h b/libavcodec/dirac_arith.h index 24a7ca390e..efe30b79de 100644 --- a/libavcodec/dirac_arith.h +++ b/libavcodec/dirac_arith.h @@ -81,6 +81,7 @@ typedef struct { const uint8_t *bytestream_end; uint16_t contexts[DIRAC_CTX_COUNT]; + int error; } DiracArith; extern const uint8_t ff_dirac_next_ctx[DIRAC_CTX_COUNT]; @@ -173,6 +174,7 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c while (!dirac_get_arith_bit(c, follow_ctx)) { if (ret >= 0x40000000) { av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n"); + c->error = AVERROR_INVALIDDATA; return -1; } ret <<= 1; |