aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dvenc.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-12-07 14:45:32 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2015-12-07 14:45:47 +0100
commit255f8966b2b5e8befcfba1908339734a3ef06a67 (patch)
treee79c32a513c8fa822fd90fd39f473748ed36385c /libavformat/dvenc.c
parentb98305f0ab01e5e46d27629e42375a98dabc73a3 (diff)
parentf7986239f4dbec91c743c4c5eb0a2339bd325bf6 (diff)
downloadffmpeg-255f8966b2b5e8befcfba1908339734a3ef06a67.tar.gz
Merge commit 'f7986239f4dbec91c743c4c5eb0a2339bd325bf6'
* commit 'f7986239f4dbec91c743c4c5eb0a2339bd325bf6': dvenc: Validate the frame size before copying it Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/dvenc.c')
-rw-r--r--libavformat/dvenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index e99ac3ce7e..502cc26a06 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -250,6 +250,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;