static double compute_target_delay(double delay, VideoState *is)
{
- double sync_threshold, diff;
+ double sync_threshold, diff = 0;
/* update delay to follow master synchronisation source */
if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) {
enum AVPixelFormat last_format = -2;
int last_serial = -1;
int last_vfilter_idx = 0;
- if (!graph)
+ if (!graph) {
+ av_frame_free(&frame);
return AVERROR(ENOMEM);
+ }
#endif
- if (!frame)
+ if (!frame) {
+#if CONFIG_AVFILTER
+ avfilter_graph_free(&graph);
+#endif
return AVERROR(ENOMEM);
+ }
for (;;) {
ret = get_video_frame(is, frame);