mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 06:53:50 +08:00
Fixed VideoCapture memory leak (bug #1481)
This commit is contained in:
parent
95e657714f
commit
689c1814a5
@ -468,6 +468,12 @@ bool CvCapture_FFMPEG::grabFrame()
|
|||||||
picture_pts = packet.pts;
|
picture_pts = packet.pts;
|
||||||
valid = 1;
|
valid = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (packet.data)
|
||||||
|
{
|
||||||
|
av_free_packet(&packet);
|
||||||
|
packet.data = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return if we have a new picture or not
|
// return if we have a new picture or not
|
||||||
|
@ -463,6 +463,12 @@ bool CvCapture_FFMPEG::grabFrame()
|
|||||||
if (count_errs > max_number_of_attempts)
|
if (count_errs > max_number_of_attempts)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (packet.data)
|
||||||
|
{
|
||||||
|
av_free_packet (&packet);
|
||||||
|
packet.data = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( valid && first_frame_number < 0 )
|
if( valid && first_frame_number < 0 )
|
||||||
|
Loading…
Reference in New Issue
Block a user