avcodec/svq3: Reject dx/dy beyond 16bit
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 27 Apr 2017 13:10:26 +0000 (15:10 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 3 May 2017 09:57:34 +0000 (11:57 +0200)
The code does use 16bit sized arrays later so larger deltas would not work

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/svq3.c

index 3e35fd7..76a465b 100644 (file)
@@ -551,7 +551,7 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode,
                 dy = get_interleaved_se_golomb(&s->gb_slice);
                 dx = get_interleaved_se_golomb(&s->gb_slice);
 
-                if (dx == INVALID_VLC || dy == INVALID_VLC) {
+                if (dx != (int16_t)dx || dy != (int16_t)dy) {
                     av_log(s->avctx, AV_LOG_ERROR, "invalid MV vlc\n");
                     return -1;
                 }