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
101 101
102 if (s->remove) {102 if (s->remove) {
103 filtered_buf = av_buffer_alloc(pkt->size + AV_INPUT_BUFFER_PADDING_SIZE);103 filtered_buf = av_buffer_alloc(pkt->size + AV_INPUT_BUFFER_PADDING_SIZE);
104 if (!filtered_buf)104 if (!filtered_buf) {
105 ret = AVERROR(ENOMEM);
105 goto fail;106 goto fail;
107 }
106 filtered_data = filtered_buf->data;108 filtered_data = filtered_buf->data;
107 }109 }
108 110
109 extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);111 extradata = av_malloc(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
110 if (!extradata) {112 if (!extradata) {
111 av_buffer_unref(&filtered_buf);113 av_buffer_unref(&filtered_buf);
114 ret = AVERROR(ENOMEM);
112 goto fail;115 goto fail;
113 }116 }
114 117

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