aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dv.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/dv.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/dv.c')
-rw-r--r--libavcodec/dv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/dv.c b/libavcodec/dv.c
index 1e190a5cbd..f548bffd8b 100644
--- a/libavcodec/dv.c
+++ b/libavcodec/dv.c
@@ -931,7 +931,9 @@ static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size,
s->sys = dv_codec_profile(c);
if (!s->sys)
return -1;
-
+ if(buf_size < s->sys->frame_size)
+ return -1;
+
c->pix_fmt = s->sys->pix_fmt;
s->picture = *((AVFrame *)data);