Commit 88d4ff4b authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/utils: Check av_packet_new_side_data() return before using it

Fixes null pointer dereference
Fixes CID1108592
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent eb5cc8fe
...@@ -1504,8 +1504,10 @@ return_packet: ...@@ -1504,8 +1504,10 @@ return_packet:
st = s->streams[pkt->stream_index]; st = s->streams[pkt->stream_index];
if (st->skip_samples) { if (st->skip_samples) {
uint8_t *p = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10); uint8_t *p = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10);
AV_WL32(p, st->skip_samples); if (p) {
av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", st->skip_samples); AV_WL32(p, st->skip_samples);
av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", st->skip_samples);
}
st->skip_samples = 0; st->skip_samples = 0;
} }
......
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