summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-17 16:26:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-17 16:26:59 +0200
commit028f8c3ecb439899be02340bbede9472771e5392 (patch)
treeb97fac00b379ba59ef74ec659259c3e5266588ac /libavcodec
parent8d0b899e38b7d33896b05625b195b83697fbbfd8 (diff)
parentf875a732e36786d49f3650e3235272891a820600 (diff)
Merge commit 'f875a732e36786d49f3650e3235272891a820600'
* commit 'f875a732e36786d49f3650e3235272891a820600': mpeg4videodec: Check the width/height in mpeg4_decode_sprite_trajectory Conflicts: libavcodec/mpeg4videodec.c See: fc5c49ab3247533e0a5cb203cf7122143389eb5c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg4videodec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index fa32aa6acd..7fe34cdcbb 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -162,7 +162,7 @@ static inline int mpeg4_is_resync(MpegEncContext *s){
return 0;
}
-static int mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)
+static int mpeg4_decode_sprite_trajectory(MpegEncContext *s, GetBitContext *gb)
{
int i;
int a= 2<<s->sprite_warping_accuracy;
@@ -178,8 +178,8 @@ static int mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)
int h= s->height;
int min_ab;
- if(w<=0 || h<=0)
- return -1;
+ if (w <= 0 || h <= 0)
+ return AVERROR_INVALIDDATA;
for(i=0; i<s->num_sprite_warping_points; i++){
int length;
@@ -428,8 +428,8 @@ int ff_mpeg4_decode_video_packet_header(MpegEncContext *s)
skip_bits(&s->gb, 3); /* intra dc vlc threshold */
//FIXME don't just ignore everything
if(s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
- if(mpeg4_decode_sprite_trajectory(s, &s->gb) < 0)
- return -1;
+ if (mpeg4_decode_sprite_trajectory(s, &s->gb) < 0)
+ return AVERROR_INVALIDDATA;
av_log(s->avctx, AV_LOG_ERROR, "untested\n");
}
@@ -2100,8 +2100,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
}
if(s->pict_type == AV_PICTURE_TYPE_S && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
- if(mpeg4_decode_sprite_trajectory(s, gb) < 0)
- return -1;
+ if (mpeg4_decode_sprite_trajectory(s, gb) < 0)
+ return AVERROR_INVALIDDATA;
if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n");
if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n");
}