[FFmpeg-cvslog] dvenc: Validate the frame size before copying it
Luca Barbato
git at videolan.org
Mon Dec 7 14:51:11 CET 2015
ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sun Oct 18 23:44:25 2015 +0200| [f7986239f4dbec91c743c4c5eb0a2339bd325bf6] | committer: Luca Barbato
dvenc: Validate the frame size before copying it
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f7986239f4dbec91c743c4c5eb0a2339bd325bf6
---
libavformat/dvenc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index a33973f..106cba4 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;
More information about the ffmpeg-cvslog
mailing list