mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avcodec/rasc: Move ff_get_buffer() after frame checks
If the frame1/2 checks fail this avoids doing the allocation of a new frame
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9f4af97aff
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0f1332309a
commit
b482e94e59
@ -723,12 +723,12 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
if (!s->frame2->data[0] || !s->frame1->data[0])
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, s->frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
copy_plane(avctx, s->frame2, s->frame);
|
||||
if (avctx->pix_fmt == AV_PIX_FMT_PAL8)
|
||||
memcpy(s->frame->data[1], s->frame2->data[1], 1024);
|
||||
|
Loading…
Reference in New Issue
Block a user