diff options
author | Diego Biurrun <diego@biurrun.de> | 2016-07-25 16:04:02 +0300 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2016-07-27 11:59:48 +0300 |
commit | e46a6fb7732a7caef97a916a4f765ec0f779d195 (patch) | |
tree | b5c51d2ab3244e75be209626281a3e0bd2bc0b21 | |
parent | 100fb0ddfda958da70f98feac81f924c02483789 (diff) |
avconv: Check that muxing_queue exists before reading from it
This avoids a segfault on nonexisting codec names.
-rw-r--r-- | avconv.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -203,13 +203,15 @@ static void avconv_cleanup(int ret) avcodec_free_context(&ost->enc_ctx); - while (av_fifo_size(ost->muxing_queue)) { - AVPacket pkt; - av_fifo_generic_read(ost->muxing_queue, &pkt, sizeof(pkt), NULL); - av_packet_unref(&pkt); + if (ost->muxing_queue) { + while (av_fifo_size(ost->muxing_queue)) { + 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_packet_unref(&pkt); + } + av_fifo_free(ost->muxing_queue); } - av_fifo_free(ost->muxing_queue); - av_freep(&output_streams[i]); } for (i = 0; i < nb_input_files; i++) { |