1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

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

Fixes null pointer dereference
Fixes CID1108592
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-10-20 18:33:53 +02:00
parent eb5cc8febc
commit 88d4ff4b5f

View File

@ -1504,8 +1504,10 @@ return_packet:
st = s->streams[pkt->stream_index];
if (st->skip_samples) {
uint8_t *p = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10);
AV_WL32(p, st->skip_samples);
av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", st->skip_samples);
if (p) {
AV_WL32(p, st->skip_samples);
av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", st->skip_samples);
}
st->skip_samples = 0;
}