aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-09-30 10:58:19 +0200
committerMarton Balint <cus@passwd.hu>2016-10-03 21:15:26 +0200
commit2face3e7b568daf70f3115126b81d5793301569c (patch)
tree4a48c6542de74e027131fa0d7bc83e0076a1f39e
parentf4e692a0e90b4301b4bc21d163cfc6420cbab7b6 (diff)
downloadffmpeg-2face3e7b568daf70f3115126b81d5793301569c.tar.gz
lavc/utils: disallow zero sized packets with data set in avcodec_send_packet
Reviewed-by: wm4 <nfxjfg@googlemail.com> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--libavcodec/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index ef3da65144..6f4df93ae6 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;