diff options
Diffstat (limited to 'source/blender/imbuf/intern/indexer.c')
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 38bd28452f3..277f50bcdbc 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -912,6 +912,8 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context, AVPacket next_packet; uint64_t stream_size; + memset(&next_packet, 0, sizeof(AVPacket)); + in_frame = avcodec_alloc_frame(); stream_size = avio_size(context->iFormatCtx->pb); @@ -959,12 +961,13 @@ static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context, * according to ffmpeg docs using 0-size packets. * * At least, if we haven't already stopped... */ + + /* this creates the 0-size packet and prevents a memory leak. */ + av_free_packet(&next_packet); + if (!*stop) { int frame_finished; - next_packet.size = 0; - next_packet.data = 0; - do { frame_finished = 0; |