[FFmpeg-cvslog] avcodec/decode: fix warning when decoding pseudo paletted formats

wm4 git at videolan.org
Thu Apr 5 18:03:04 EEST 2018


ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Wed Apr  4 18:07:03 2018 +0200| [709e0291d659d089527ec7c048f9b2608183df64] | committer: wm4

avcodec/decode: fix warning when decoding pseudo paletted formats

The pseudo palette allocation is optional now. But if it's still
allocated (like the internal get_buffer2 implementation does, for
compatibility), it shouldn't print a warning.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=709e0291d659d089527ec7c048f9b2608183df64
---

 libavcodec/decode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index d883a5f9fc..421a8f1a35 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1779,6 +1779,8 @@ static void validate_avframe_allocation(AVCodecContext *avctx, AVFrame *frame)
         int flags = desc ? desc->flags : 0;
         if (num_planes == 1 && (flags & AV_PIX_FMT_FLAG_PAL))
             num_planes = 2;
+        if ((flags & FF_PSEUDOPAL) && frame->data[1])
+            num_planes = 2;
         for (i = 0; i < num_planes; i++) {
             av_assert0(frame->data[i]);
         }



More information about the ffmpeg-cvslog mailing list