[FFmpeg-devel] [PATCH v3 3/3] avcodec/libx264: return error if unknown picture type encountered

Anton Khirnov anton at khirnov.net
Sun May 10 20:43:25 EEST 2020


Quoting lance.lmwang at gmail.com (2020-04-18 06:52:49)
> From: Limin Wang <lance.lmwang at gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
>  libavcodec/libx264.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index edd343e..3fa2311 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -476,7 +476,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
>          pict_type = AV_PICTURE_TYPE_B;
>          break;
>      default:
> -        pict_type = AV_PICTURE_TYPE_NONE;
> +        av_log(ctx, AV_LOG_ERROR, "Unknown picture type encountered.\n");
> +        return AVERROR_EXTERNAL;

Why should that cause encoding to fail?
And when would this happen?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list