[FFmpeg-devel] [PATCH 1/3] lavc/utils: disallow zero sized packets with data set in avcodec_send_packet

Marton Balint cus at passwd.hu
Fri Sep 30 12:29:05 EEST 2016


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavcodec/utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index cf85300..d0a6817 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2813,6 +2813,9 @@ int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacke
     if (avctx->internal->draining)
         return AVERROR_EOF;
 
+    if (avpkt && !avpkt->size && avpkt->data)
+        return AVERROR(EINVAL);
+
     if (!avpkt || !avpkt->size) {
         avctx->internal->draining = 1;
         avpkt = NULL;
-- 
2.6.6



More information about the ffmpeg-devel mailing list