v4l2_m2m: decoder: fix memory leak

This commit is contained in:
Lukas Rusak 2018-06-26 14:36:46 -07:00 committed by Jorge Ramirez-Ortiz
parent 7becc70375
commit 7395f13df9

View File

@ -149,11 +149,14 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)
if (avpkt.size) {
ret = v4l2_try_start(avctx);
if (ret)
if (ret) {
av_packet_unref(&avpkt);
return 0;
}
}
dequeue:
av_packet_unref(&avpkt);
return ff_v4l2_context_dequeue_frame(capture, frame);
}