Merge commit '8e104619a627fcf5f4c2bd3c09d0c2d323aae745'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 13 Nov 2014 13:21:58 +0000 (14:21 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 13 Nov 2014 13:21:58 +0000 (14:21 +0100)
* commit '8e104619a627fcf5f4c2bd3c09d0c2d323aae745':
  shorten: check for return value

Conflicts:
libavcodec/shorten.c

See: e20ebe491c17388a312e04ff060c217ecfafc914
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/shorten.c

@@@ -505,16 -508,11 +505,16 @@@ static int shorten_decode_frame(AVCodec
                  while (len--)
                      get_ur_golomb_shorten(&s->gb, VERBATIM_BYTE_SIZE);
                  break;
 -            case FN_BITSHIFT:
 -                s->bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
 -                if (s->bitshift < 0)
 +            case FN_BITSHIFT: {
 +                unsigned bitshift = get_ur_golomb_shorten(&s->gb, BITSHIFTSIZE);
 +                if (bitshift > 31) {
 +                    av_log(avctx, AV_LOG_ERROR, "bitshift %d is invalid\n",
 +                           bitshift);
-                     return AVERROR_PATCHWELCOME;
+                     return AVERROR_INVALIDDATA;
 +                }
 +                s->bitshift = bitshift;
                  break;
 +            }
              case FN_BLOCKSIZE: {
                  unsigned blocksize = get_uint(s, av_log2(s->blocksize));
                  if (blocksize > s->blocksize) {