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>
This commit is contained in:
Marton Balint 2016-09-30 10:58:19 +02:00
parent f4e692a0e9
commit 2face3e7b5

View 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;