summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-04-22 16:32:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-22 17:40:55 +0200
commit3339bae2197a2a02b090e74a8720282b5b87598e (patch)
tree90a7147074e3c40a202ece9a8652fcea8c155a6a
parent0b5405c443ec8adc3c114e508b71ce2012c83f0d (diff)
downloadffmpeg-3339bae2197a2a02b090e74a8720282b5b87598e.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) Conflicts: libavcodec/mpeg4videodec.c
-rw-r--r--libavcodec/mpeg4videodec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 7a4a441100..6d2a0eddd4 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -186,13 +186,13 @@ static int mpeg4_decode_sprite_trajectory(MpegEncContext *s, GetBitContext *gb)
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(!(s->divx_version==500 && s->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 */