On Fri, 30 Sep 2016 11:29:05 +0200
Marton Balint <c...@passwd.hu> wrote:

> Signed-off-by: Marton Balint <c...@passwd.hu>
> ---
>  libavcodec/utils.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index cf85300..d0a6817 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -2813,6 +2813,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;

This means packet with size==0 with data!=NULL will be rejected,
instead of being interpreted as flush packets.

Fine with me. Still allows "normal" flush packets, and probably
prevents that API users accidentally enter the EOF state by sending such
packets.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to