Commit bb502411 authored by Paul B Mahol's avatar Paul B Mahol

nutdec: check return value of av_new_packet()

Fixes CID733173.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 8cbb8f53
...@@ -854,7 +854,8 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) ...@@ -854,7 +854,8 @@ 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]); if (av_new_packet(pkt, size + nut->header_len[header_idx]) < 0)
return AVERROR(ENOMEM);
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment