u/sink: Make sure to free frame when we fail to decode

This commit is contained in:
Jakob Bornecrantz committed 2021-08-20 18:55:21 +01:00
1 parent 8225539178
commit 49e6514a3d
1 file changed
+6
@@ -480,6 +480,8 @@ convert_frame_r8g8b8_or_l8(struct xrt_frame_sink *xs, struct xrt_frame *xf)
return;
}
if (!from_MJPEG_to_R8G8B8(converted, xf->size, xf->data)) {
// Make sure to free frame when we fail to decode.
xrt_frame_reference(&converted, NULL);
return;
}
break;
@@ -530,6 +532,8 @@ convert_frame_r8g8b8_bayer_or_l8(struct xrt_frame_sink *xs, struct xrt_frame *xf
return;
}
if (!from_MJPEG_to_R8G8B8(converted, xf->size, xf->data)) {
// Make sure to free frame when we fail to decode.
xrt_frame_reference(&converted, NULL);
return;
}
break;
@@ -586,6 +590,8 @@ convert_frame_r8g8b8(struct xrt_frame_sink *xs, struct xrt_frame *xf)
return;
}
if (!from_MJPEG_to_R8G8B8(converted, xf->size, xf->data)) {
// Make sure to free frame when we fail to decode.
xrt_frame_reference(&converted, NULL);
return;
}
break;