Commit 34d415fb authored by fenrir's avatar fenrir

Fixed overreads in TTA decoder with corrupted bistreams.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22176 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 318badf1
...@@ -332,9 +332,14 @@ static int tta_decode_frame(AVCodecContext *avctx, ...@@ -332,9 +332,14 @@ static int tta_decode_frame(AVCodecContext *avctx,
unary--; unary--;
} }
if (k) if (get_bits_left(&s->gb) < k)
return -1;
if (k) {
if (k > MIN_CACHE_BITS)
return -1;
value = (unary << k) + get_bits(&s->gb, k); value = (unary << k) + get_bits(&s->gb, k);
else } else
value = unary; value = unary;
// FIXME: copy paste from original // FIXME: copy paste from original
...@@ -404,6 +409,8 @@ static int tta_decode_frame(AVCodecContext *avctx, ...@@ -404,6 +409,8 @@ static int tta_decode_frame(AVCodecContext *avctx,
} }
} }
if (get_bits_left(&s->gb) < 32)
return -1;
skip_bits(&s->gb, 32); // frame crc skip_bits(&s->gb, 32); // frame crc
// convert to output buffer // convert to output buffer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment