]> git.sesse.net Git - ffmpeg/commitdiff
dvenc: Validate the frame size before copying it
authorLuca Barbato <lu_zero@gentoo.org>
Sun, 18 Oct 2015 21:44:25 +0000 (23:44 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 28 Nov 2015 16:02:15 +0000 (17:02 +0100)
libavformat/dvenc.c

index a33973f19266945af28d43bba980a9b09c3a11fa..106cba4c3457731f030052f571b24aa363cd439c 100644 (file)
@@ -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;