diff --git a/libavcodec/psd.c b/libavcodec/psd.c index 9c3e4f6905..f0b90ec1bd 100644 --- a/libavcodec/psd.c +++ b/libavcodec/psd.c @@ -418,9 +418,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, s->uncompressed_size = s->line_size * s->height * s->channel_count; - if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) - return ret; - /* decode picture if need */ if (s->compression == PSD_RLE) { s->tmp = av_malloc(s->uncompressed_size); @@ -443,6 +440,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, ptr_data = s->gb.buffer; } + if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) + return ret; + /* Store data */ if ((avctx->pix_fmt == AV_PIX_FMT_YA8)||(avctx->pix_fmt == AV_PIX_FMT_YA16BE)){/* Interleaved */ ptr = picture->data[0];