You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/psd: Move frame allocation after RLE processing
Fixes: Timeout Fixes: 410609448/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PSD_fuzzer-6267226128973824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -418,9 +418,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
|
|||||||
|
|
||||||
s->uncompressed_size = s->line_size * s->height * s->channel_count;
|
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 */
|
/* decode picture if need */
|
||||||
if (s->compression == PSD_RLE) {
|
if (s->compression == PSD_RLE) {
|
||||||
s->tmp = av_malloc(s->uncompressed_size);
|
s->tmp = av_malloc(s->uncompressed_size);
|
||||||
@ -443,6 +440,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
|
|||||||
ptr_data = s->gb.buffer;
|
ptr_data = s->gb.buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
/* Store data */
|
/* Store data */
|
||||||
if ((avctx->pix_fmt == AV_PIX_FMT_YA8)||(avctx->pix_fmt == AV_PIX_FMT_YA16BE)){/* Interleaved */
|
if ((avctx->pix_fmt == AV_PIX_FMT_YA8)||(avctx->pix_fmt == AV_PIX_FMT_YA16BE)){/* Interleaved */
|
||||||
ptr = picture->data[0];
|
ptr = picture->data[0];
|
||||||
|
Reference in New Issue
Block a user