diff options
author | Marton Balint <cus@passwd.hu> | 2016-09-30 10:58:19 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2016-10-03 21:15:26 +0200 |
commit | 2face3e7b568daf70f3115126b81d5793301569c (patch) | |
tree | 4a48c6542de74e027131fa0d7bc83e0076a1f39e | |
parent | f4e692a0e90b4301b4bc21d163cfc6420cbab7b6 (diff) | |
download | ffmpeg-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.c | 3 |
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; |