History

avcodec/hevc/hevcdec: handle rpu_buf allocation failure correctly

Kacper Michajłow committed 1 year ago

Commit bf640b51 parent 29368cc1 file · +4 −2Browse files

Unified · Split

libavcodec/hevc/hevcdec.c+4−2
@@ -3747,8 +3747,10 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) · 3746 unmodified lines
37473747 }
37483748
37493749 s->rpu_buf = av_buffer_alloc(nal->raw_size - 2);
3750− if (!s->rpu_buf)
3751− return AVERROR(ENOMEM);
3750+ if (!s->rpu_buf) {
3751+ ret = AVERROR(ENOMEM);
3752+ goto fail;
3753+ }
37523754 memcpy(s->rpu_buf->data, nal->raw_data + 2, nal->raw_size - 2);
37533755
37543756 ret = ff_dovi_rpu_parse(&s->dovi_ctx, nal->data + 2, nal->size - 2,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t