diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-11-11 17:40:08 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-11-13 01:41:26 +0100 |
commit | 8e104619a627fcf5f4c2bd3c09d0c2d323aae745 (patch) | |
tree | aaf151d844e967cd983ebd04b52575338fb54924 /libavcodec/shorten.c | |
parent | d5d2d6c3b8cff61eb26c18bbd977881cf6d5524a (diff) | |
download | ffmpeg-8e104619a627fcf5f4c2bd3c09d0c2d323aae745.tar.gz |
shorten: check for return value
Avoid a possible negative bitshift.
CC: libav-stable@libav.org
Bug-Id: CID 1194400
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r-- | libavcodec/shorten.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index c465fffe05..c93ba6b026 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -510,6 +510,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, break; case FN_BITSHIFT: s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE); + if (s->bitshift < 0) + return AVERROR_INVALIDDATA; break; case FN_BLOCKSIZE: { unsigned blocksize = get_uint(s, av_log2(s->blocksize)); |