提交 9cdddb93 编写于 作者: A Andreas Cadhalpun 提交者: Anton Khirnov

nutdec: only copy the header if it exists

Fixes runtime error: null pointer passed as argument 2, which is
declared to never be null
Signed-off-by: NAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: NAnton Khirnov <anton@khirnov.net>
上级 8431629d
......@@ -890,7 +890,8 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
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]);
if (nut->header[header_idx])
memcpy(pkt->data, nut->header[header_idx], nut->header_len[header_idx]);
pkt->pos = avio_tell(bc); // FIXME
avio_read(bc, pkt->data + nut->header_len[header_idx], size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册