aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-01-12 00:16:25 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-01-12 00:16:25 +0000
commit0ecca7a49f8e254c12a3a1de048d738bfbb614c6 (patch)
tree816c7073739d918ca579171204e6d3caf9977da5 /libavcodec/vp3.c
parentf14d4e7e21c48967c1a877fa9c4eb9943d2c30f5 (diff)
downloadffmpeg-0ecca7a49f8e254c12a3a1de048d738bfbb614c6.tar.gz
various security fixes and precautionary checks
Originally committed as revision 3822 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r--libavcodec/vp3.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 4c7976cde9..8b90438d20 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2093,6 +2093,9 @@ static void render_fragments(Vp3DecodeContext *s,
upper_motion_limit = 7 * s->current_frame.linesize[2];
lower_motion_limit = height * s->current_frame.linesize[2] + width - 8;
}
+
+ if((unsigned)stride > 2048)
+ return; //various tables are fixed size
/* for each fragment row... */
for (y = 0; y < height; y += 8) {
@@ -2681,6 +2684,11 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext gb)
s->width = get_bits(&gb, 16) << 4;
s->height = get_bits(&gb, 16) << 4;
+ if(avcodec_check_dimensions(avctx, s->width, s->height)){
+ s->width= s->height= 0;
+ return -1;
+ }
+
skip_bits(&gb, 24); /* frame width */
skip_bits(&gb, 24); /* frame height */