diff options
Diffstat (limited to 'fftools/ffmpeg_demux.c')
-rw-r--r-- | fftools/ffmpeg_demux.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index d7dde1028f..31b233c4f4 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -117,10 +117,16 @@ static int seek_to_start(InputFile *ifile) static void *input_thread(void *arg) { InputFile *f = arg; - AVPacket *pkt = f->pkt; + AVPacket *pkt; unsigned flags = f->non_blocking ? AV_THREAD_MESSAGE_NONBLOCK : 0; int ret = 0; + pkt = av_packet_alloc(); + if (!pkt) { + ret = AVERROR(ENOMEM); + goto finish; + } + while (1) { DemuxMsg msg = { NULL }; @@ -185,9 +191,12 @@ static void *input_thread(void *arg) } } +finish: av_assert0(ret < 0); av_thread_message_queue_set_err_recv(f->in_thread_queue, ret); + av_packet_free(&pkt); + return NULL; } |