Commit 689c1814 authored by Alexander Reshetnikov's avatar Alexander Reshetnikov

Fixed VideoCapture memory leak (bug #1481)

parent 95e65771
......@@ -468,6 +468,12 @@ bool CvCapture_FFMPEG::grabFrame()
picture_pts = packet.pts;
valid = 1;
}
if (packet.data)
{
av_free_packet(&packet);
packet.data = NULL;
}
}
// return if we have a new picture or not
......
......@@ -463,6 +463,12 @@ bool CvCapture_FFMPEG::grabFrame()
if (count_errs > max_number_of_attempts)
break;
}
if (packet.data)
{
av_free_packet (&packet);
packet.data = NULL;
}
}
if( valid && first_frame_number < 0 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment