1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/hevc/hevcdec: handle rpu_buf allocation failure correctly

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
Kacper Michajłow
2025-07-25 18:50:06 +02:00
committed by Niklas Haas
parent 29368ccb48
commit bf640b53db

View File

@ -3747,8 +3747,10 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
} }
s->rpu_buf = av_buffer_alloc(nal->raw_size - 2); s->rpu_buf = av_buffer_alloc(nal->raw_size - 2);
if (!s->rpu_buf) if (!s->rpu_buf) {
return AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail;
}
memcpy(s->rpu_buf->data, nal->raw_data + 2, nal->raw_size - 2); memcpy(s->rpu_buf->data, nal->raw_data + 2, nal->raw_size - 2);
ret = ff_dovi_rpu_parse(&s->dovi_ctx, nal->data + 2, nal->size - 2, ret = ff_dovi_rpu_parse(&s->dovi_ctx, nal->data + 2, nal->size - 2,