avcodec/a64multienc: Assert that the Packet size does not grow
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 23 Feb 2015 00:58:11 +0000 (01:58 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 00:52:51 +0000 (01:52 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 29bbc1be488ea4fc591d3e0ef12f0fc7c8812afb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/a64multienc.c

index 34e5b2d..0d92667 100644 (file)
@@ -28,6 +28,7 @@
 #include "a64tables.h"
 #include "elbg.h"
 #include "internal.h"
+#include "libavutil/avassert.h"
 #include "libavutil/common.h"
 #include "libavutil/intreadwrite.h"
 
@@ -379,6 +380,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         pkt->pts = pkt->dts = c->next_pts;
         c->next_pts         = AV_NOPTS_VALUE;
 
+        av_assert0(pkt->size >= req_size);
         pkt->size   = req_size;
         pkt->flags |= AV_PKT_FLAG_KEY;
         *got_packet = !!req_size;