nutdec: check av_new_packet return value
CC: libav-stable@libav.org Bug-Id: CID 733713
This commit is contained in:
parent
b69183f65d
commit
af7ca6ea12
@ -823,7 +823,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
|
|||||||
{
|
{
|
||||||
AVFormatContext *s = nut->avf;
|
AVFormatContext *s = nut->avf;
|
||||||
AVIOContext *bc = s->pb;
|
AVIOContext *bc = s->pb;
|
||||||
int size, stream_id, discard;
|
int size, stream_id, discard, ret;
|
||||||
int64_t pts, last_IP_pts;
|
int64_t pts, last_IP_pts;
|
||||||
StreamContext *stc;
|
StreamContext *stc;
|
||||||
uint8_t header_idx;
|
uint8_t header_idx;
|
||||||
@ -848,7 +848,9 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
av_new_packet(pkt, size + nut->header_len[header_idx]);
|
ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
|
memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
|
||||||
pkt->pos = avio_tell(bc); // FIXME
|
pkt->pos = avio_tell(bc); // FIXME
|
||||||
avio_read(bc, pkt->data + nut->header_len[header_idx], size);
|
avio_read(bc, pkt->data + nut->header_len[header_idx], size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user