aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-04-22 16:32:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-21 20:43:36 +0200
commit5ae8df8d37c2af50a3f35550a2010ba2a2760e75 (patch)
tree266ed06a3dc962af402b046af05dc6698305e1e6
parentaf70697836bbe1e4f0e3cfbdc7f18b23290245b5 (diff)
downloadffmpeg-5ae8df8d37c2af50a3f35550a2010ba2a2760e75.tar.gz
mpeg4videodec: only allow a positive length
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit b3408ae4c64cb674b1d5f0f30171759113ce722a) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpeg4videodec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 1daecfa76e..6a2e06acfa 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -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))
skip_bits1(gb); /* marker bit */
length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);
- if (length)
+ if (length > 0)
y = get_xbits(gb, length);
skip_bits1(gb); /* marker bit */