aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2015-10-18 23:44:25 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-11-28 17:02:15 +0100
commitf7986239f4dbec91c743c4c5eb0a2339bd325bf6 (patch)
tree445352023d5c7e49b2aa814a1851c111dc77956c
parent7139489c452ef8af6a745ec4e62056ee4ea4d6a8 (diff)
downloadffmpeg-f7986239f4dbec91c743c4c5eb0a2339bd325bf6.tar.gz
dvenc: Validate the frame size before copying it
-rw-r--r--libavformat/dvenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index a33973f192..106cba4c34 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -249,6 +249,11 @@ static int dv_assemble_frame(DVMuxContext *c, AVStream* st,
/* FIXME: we have to have more sensible approach than this one */
if (c->has_video)
av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames);
+ if (data_size != c->sys->frame_size) {
+ av_log(st->codec, AV_LOG_ERROR, "Unexpected frame size, %d != %d\n",
+ data_size, c->sys->frame_size);
+ return AVERROR(ENOSYS);
+ }
memcpy(*frame, data, c->sys->frame_size);
c->has_video = 1;