Message ID | 20200418045249.8057-3-lance.lmwang@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [FFmpeg-devel,v3,1/3] avcodec/libx265: Fix Uninitialized scalar variable | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
Quoting lance.lmwang@gmail.com (2020-04-18 06:52:49) > From: Limin Wang <lance.lmwang@gmail.com> > > Signed-off-by: Limin Wang <lance.lmwang@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?
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; } #if FF_API_CODED_FRAME FF_DISABLE_DEPRECATION_WARNINGS