History

nutdec: check av_new_packet return value

Vittorio Giovara committed 12 years ago

Commit af7ca6e1 parent b69183f1 file · +4 −2Browse files

Unified · Split

libavformat/nutdec.c+4−2
@@ -823,7 +823,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) · 822 unmodified lines
823823 {
824824 AVFormatContext *s = nut->avf;
825825 AVIOContext *bc = s->pb;
826− int size, stream_id, discard;
826+ int size, stream_id, discard, ret;
827827 int64_t pts, last_IP_pts;
828828 StreamContext *stc;
829829 uint8_t header_idx;
@@ -848,7 +848,9 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) · 18 unmodified lines
848848 return 1;
849849 }
850850
851− av_new_packet(pkt, size + nut->header_len[header_idx]);
851+ ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
852+ if (ret < 0)
853+ return ret;
852854 memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
853855 pkt->pos = avio_tell(bc); // FIXME
854856 avio_read(bc, pkt->data + nut->header_len[header_idx], size);

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