mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avcodec/cfhd: Make sure we have an end of header tag before allocating a frame.
Fixes tickets #5208 and #5209
This commit is contained in:
parent
9effa01255
commit
bdd8e02b72
@ -224,7 +224,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
GetByteContext gb;
|
GetByteContext gb;
|
||||||
ThreadFrame frame = { .f = data };
|
ThreadFrame frame = { .f = data };
|
||||||
AVFrame *pic = data;
|
AVFrame *pic = data;
|
||||||
int ret = 0, i, j, plane;
|
int ret = 0, i, j, plane, got_buffer = 0;
|
||||||
int16_t *coeff_data;
|
int16_t *coeff_data;
|
||||||
|
|
||||||
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
|
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
|
||||||
@ -426,6 +426,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
|
|
||||||
s->coded_width = 0;
|
s->coded_width = 0;
|
||||||
s->coded_height = 0;
|
s->coded_height = 0;
|
||||||
|
got_buffer = 1;
|
||||||
}
|
}
|
||||||
coeff_data = s->plane[s->channel_num].subband[s->subband_num_actual];
|
coeff_data = s->plane[s->channel_num].subband[s->subband_num_actual];
|
||||||
|
|
||||||
@ -557,6 +558,12 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!got_buffer) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "No end of header tag found\n");
|
||||||
|
ret = AVERROR(EINVAL);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
for (plane = 0; plane < 3 && !ret; plane++) {
|
for (plane = 0; plane < 3 && !ret; plane++) {
|
||||||
/* level 1 */
|
/* level 1 */
|
||||||
int lowpass_height = s->plane[plane].band[0][0].height;
|
int lowpass_height = s->plane[plane].band[0][0].height;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user