mpeg4videodec: only allow a positive length
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Wed, 22 Apr 2015 14:32:42 +0000 (16:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 22 Apr 2015 14:57:52 +0000 (16:57 +0200)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpeg4videodec.c

index 8449392..9bf33dd 100644 (file)
@@ -189,14 +189,14 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
         int x = 0, y = 0;
 
         length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);
-        if (length)
+        if (length > 0)
             x = get_xbits(gb, length);
 
         if (!(ctx->divx_version == 500 && ctx->divx_build == 413))
             check_marker(gb, "before sprite_trajectory");
 
         length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);
-        if (length)
+        if (length > 0)
             y = get_xbits(gb, length);
 
         check_marker(gb, "after sprite_trajectory");