lavc/utils: disallow zero sized packets with data set in avcodec_send_packet
authorMarton Balint <cus@passwd.hu>
Fri, 30 Sep 2016 08:58:19 +0000 (10:58 +0200)
committerMarton Balint <cus@passwd.hu>
Mon, 3 Oct 2016 19:15:26 +0000 (21:15 +0200)
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
libavcodec/utils.c

index ef3da65..6f4df93 100644 (file)
@@ -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;