Browse code

avcodec/a64multienc: Assert that the Packet size does not grow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2015/02/23 09:58:11
Showing 1 changed files
... ...
@@ -28,6 +28,7 @@
28 28
 #include "a64tables.h"
29 29
 #include "elbg.h"
30 30
 #include "internal.h"
31
+#include "libavutil/avassert.h"
31 32
 #include "libavutil/common.h"
32 33
 #include "libavutil/intreadwrite.h"
33 34
 
... ...
@@ -385,6 +386,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
385 385
         pkt->pts = pkt->dts = c->next_pts;
386 386
         c->next_pts         = AV_NOPTS_VALUE;
387 387
 
388
+        av_assert0(pkt->size >= req_size);
388 389
         pkt->size   = req_size;
389 390
         pkt->flags |= AV_PKT_FLAG_KEY;
390 391
         *got_packet = !!req_size;