Commit 3938a0ee authored by Michael Niedermayer's avatar Michael Niedermayer

audio_frame_queue: fix null ptr dereference

This happened when a frame was removed before any was added.
Fixes part of Ticket1208

Found-by: John Villamil, Piotr Bandurski and Carl Eugen Hoyos
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4c73b3b1
......@@ -100,7 +100,7 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
if(nb_samples){
av_assert0(!afq->frame_count);
if(afq->frames[0].pts != AV_NOPTS_VALUE)
if(afq->frames && afq->frames[0].pts != AV_NOPTS_VALUE)
afq->frames[0].pts += nb_samples;
av_log(afq->avctx, AV_LOG_DEBUG, "Trying to remove %d more samples than are in the que\n", nb_samples);
}
......
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