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
823{823{
824 AVFormatContext *s = nut->avf;824 AVFormatContext *s = nut->avf;
825 AVIOContext *bc = s->pb;825 AVIOContext *bc = s->pb;
826 int size, stream_id, discard;826 int size, stream_id, discard, ret;
827 int64_t pts, last_IP_pts;827 int64_t pts, last_IP_pts;
828 StreamContext *stc;828 StreamContext *stc;
829 uint8_t header_idx;829 uint8_t header_idx;
@@ -848,7 +848,9 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) · 18 unmodified lines
848 return 1;848 return 1;
849 }849 }
850 850
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;
852 memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);854 memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
853 pkt->pos = avio_tell(bc); // FIXME855 pkt->pos = avio_tell(bc); // FIXME
854 avio_read(bc, pkt->data + nut->header_len[header_idx], size);856 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