aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-01 04:57:22 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-19 03:51:38 +0100
commitba1715f52a96edf74b0bc3182f4db2618f1eec8f (patch)
tree0f40efd76839e5d2015d78695aefbc1b68da16c2 /libavcodec
parent2d9f536cd95f601e7ebda8b148ec39f02c739eb4 (diff)
downloadffmpeg-ba1715f52a96edf74b0bc3182f4db2618f1eec8f.tar.gz
avcodec/truemotion1: Check for even width
Fixes out of array access Fixes: 87196d8bbc633629fc9dd851fce73e70/asan_heap-oob_26f6853_862_cov_585961513_sonic3dblast_intro-partial.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 63fb5a6aefb4223334001fd2c0d82a5e22e3b528) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/truemotion1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index 660ecf5413..b2de889c46 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -402,6 +402,10 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
new_pix_fmt = AV_PIX_FMT_RGB555; // RGB565 is supported as well
s->w >>= width_shift;
+ if (s->w & 1) {
+ avpriv_request_sample(s->avctx, "Frame with odd width");
+ return AVERROR_PATCHWELCOME;
+ }
if (s->w != s->avctx->width || s->h != s->avctx->height ||
new_pix_fmt != s->avctx->pix_fmt) {