1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avconv: Check that muxing_queue exists before reading from it

This avoids a segfault on nonexisting codec names.
This commit is contained in:
Diego Biurrun
2016-07-25 15:04:02 +02:00
parent 100fb0ddfd
commit e46a6fb773

View File

@@ -203,13 +203,15 @@ static void avconv_cleanup(int ret)
avcodec_free_context(&ost->enc_ctx); avcodec_free_context(&ost->enc_ctx);
if (ost->muxing_queue) {
while (av_fifo_size(ost->muxing_queue)) { while (av_fifo_size(ost->muxing_queue)) {
AVPacket pkt; AVPacket pkt;
av_log(NULL, AV_LOG_INFO, "after av_fifo_size()\n");
av_fifo_generic_read(ost->muxing_queue, &pkt, sizeof(pkt), NULL); av_fifo_generic_read(ost->muxing_queue, &pkt, sizeof(pkt), NULL);
av_packet_unref(&pkt); av_packet_unref(&pkt);
} }
av_fifo_free(ost->muxing_queue); av_fifo_free(ost->muxing_queue);
}
av_freep(&output_streams[i]); av_freep(&output_streams[i]);
} }
for (i = 0; i < nb_input_files; i++) { for (i = 0; i < nb_input_files; i++) {