History

avcodec/extract_extradata: return an error when buffer allocation fails

ret is 0 by default.

James Almer committed 9 years ago

Commit 7bae17e1 parent 4d390341 file · +4 −1Browse files

Unified · Split

libavcodec/extract_extradata_bsf.c+4−1
@@ -101,14 +101,17 @@ static int extract_extradata_h2645(AVBSFContext *ctx, AVPacket *pkt, · 100 unmodified lines
101101
102102 if (s->remove) {
103103 filtered_buf = av_buffer_alloc(pkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
104− if (!filtered_buf)
104+ if (!filtered_buf) {
105+ ret = AVERROR(ENOMEM);
105106 goto fail;
107+ }
106108 filtered_data = filtered_buf->data;
107109 }
108110
109111 extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
110112 if (!extradata) {
111113 av_buffer_unref(&filtered_buf);
114+ ret = AVERROR(ENOMEM);
112115 goto fail;
113116 }
114117

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