[FFmpeg-cvslog] lavc/utils: disallow zero sized packets with data set in avcodec_send_packet

Marton Balint git at videolan.org
Mon Oct 3 23:34:43 EEST 2016


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Fri Sep 30 10:58:19 2016 +0200| [2face3e7b568daf70f3115126b81d5793301569c] | committer: Marton Balint

lavc/utils: disallow zero sized packets with data set in avcodec_send_packet

Reviewed-by: wm4 <nfxjfg at googlemail.com>
Reviewed-by: Hendrik Leppkes <h.leppkes at gmail.com>
Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2face3e7b568daf70f3115126b81d5793301569c
---

 libavcodec/utils.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ef3da65..6f4df93 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2819,6 +2819,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;



More information about the ffmpeg-cvslog mailing list