diff options
author | Marton Balint <cus@passwd.hu> | 2016-09-30 11:58:19 +0300 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2016-10-03 22:15:26 +0300 |
commit | 2face3e7b568daf70f3115126b81d5793301569c (patch) | |
tree | 4a48c6542de74e027131fa0d7bc83e0076a1f39e /libavcodec/utils.c | |
parent | f4e692a0e90b4301b4bc21d163cfc6420cbab7b6 (diff) |
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>
Diffstat (limited to 'libavcodec/utils.c')
-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; |