[FFmpeg-cvslog] shorten: check for return value

Vittorio Giovara git at videolan.org
Thu Nov 13 14:29:16 CET 2014


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Tue Nov 11 17:40:08 2014 +0100| [8e104619a627fcf5f4c2bd3c09d0c2d323aae745] | committer: Vittorio Giovara

shorten: check for return value

Avoid a possible negative bitshift.

CC: libav-stable at libav.org
Bug-Id: CID 1194400

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8e104619a627fcf5f4c2bd3c09d0c2d323aae745
---

 libavcodec/shorten.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index c465fff..c93ba6b 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));



More information about the ffmpeg-cvslog mailing list