1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

roqaudio: Always use the frame buffer on flush

Prevent NULL dereference.

CC: libav-stable@libav.org
Bug-Id: CID 703669
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
Michael Niedermayer 2014-11-12 11:13:10 +01:00 committed by Vittorio Giovara
parent 0562887a98
commit 55b59fab88

View File

@ -147,15 +147,16 @@ static int roq_dpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
context->input_frames++;
return 0;
}
in = context->frame_buffer;
}
if (context->input_frames < 8)
in = context->frame_buffer;
if (stereo) {
context->lastSample[0] &= 0xFF00;
context->lastSample[1] &= 0xFF00;
}
if (context->input_frames == 7 || !in)
if (context->input_frames == 7)
data_size = avctx->channels * context->buffered_samples;
else
data_size = avctx->channels * avctx->frame_size;