nutdec: only copy the header if it exists
Fixes ubsan runtime error: null pointer passed as argument 2, which is
declared to never be null
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9f82506c79
)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
@@ -1069,6 +1069,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
|
|||||||
ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
|
ret = av_new_packet(pkt, size + nut->header_len[header_idx]);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
if (nut->header[header_idx])
|
||||||
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
|
||||||
if (stc->last_flags & FLAG_SM_DATA) {
|
if (stc->last_flags & FLAG_SM_DATA) {
|
||||||
|
Reference in New Issue
Block a user