<div dir="auto">Hi,<div dir="auto">Got it. I'll send a completely new patch by merging the two commits on my local repo using git rebase.<div dir="auto"><br></div><div dir="auto">Also, let me know if the commit message looks good to you. I did changes according to your comments on the v1 patch</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Vedant Paranjape</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 2 Jun, 2021, 01:41 Laurent Pinchart, <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Vedant,<br>
<br>
On Wed, Jun 02, 2021 at 12:57:26AM +0530, Vedant Paranjape wrote:<br>
> Hey,<br>
> I think I messed up with the commit history in this patch, do you want me<br>
> to rebase the commit in v1 and v2 together and send a new patch ?<br>
<br>
Please do. As a general rule, patches should be based on the master<br>
branch of libcamera. In this particular case, we won't apply v1 (given<br>
that it didn't pass the review step), so v2 has to be self-contained.<br>
There are multiple reasons for that, two major ones are to avoid<br>
bisection breakages (if v1 introduces a problem that gets noticed during<br>
review, applying v1 and a fix on top of it would cause breakages when<br>
testing the version with v1 without the fix), and to show the whole<br>
context during review (if I were to review this v2, I would need to<br>
first apply your v1, then v2, and review the result).<br>
<br>
> On Wed, Jun 2, 2021 at 12:54 AM Vedant Paranjape wrote:<br>
> > Error checking the output from generateConfiguration() was missing in<br>
> > the code. Only assert was added as a guard which checked if the size of<br>
> > generated camera config was equal to size of roles passed to it.<br>
> ><br>
> > If the roles argument has a invalid member, it will return a nullptr and then<br>
> > trying to access a member on a nullptr for size comparison will result in a<br>
> > segmentation fault. So, if the function returns a nullptr, it will simply put<br>
> > a error on GstBus and gracefully exit.<br>
> ><br>
> > Signed-off-by: Vedant Paranjape <<a href="mailto:vedantparanjape160201@gmail.com" target="_blank" rel="noreferrer">vedantparanjape160201@gmail.com</a>><br>
> > ---<br>
> >  src/gstreamer/gstlibcamerasrc.cpp | 4 ++--<br>
> >  1 file changed, 2 insertions(+), 2 deletions(-)<br>
> ><br>
> > diff --git a/src/gstreamer/gstlibcamerasrc.cpp<br>
> > b/src/gstreamer/gstlibcamerasrc.cpp<br>
> > index 8b6057df..910c0f83 100644<br>
> > --- a/src/gstreamer/gstlibcamerasrc.cpp<br>
> > +++ b/src/gstreamer/gstlibcamerasrc.cpp<br>
> > @@ -375,9 +375,9 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,<br>
> ><br>
> >         /* Generate the stream configurations, there should be one per pad. */<br>
> >         state->config_ = state->cam_->generateConfiguration(roles);<br>
> > -       if (state->config_ == nullptr) {<br>
> > +       if (state->config_ == nullptr && state->config_->size() == state->srcpads_.size()) {<br>
> >                 GST_ELEMENT_ERROR(self, RESOURCE, SETTINGS,<br>
> > -                                 ("Failed to generate camera configuration from roles"),<br>
> > +                                 ("Failed to generate camera configuration from"),<br>
> >                                   ("Camera::generateConfiguration() returned nullptr"));<br>
> >                 gst_task_stop(task);<br>
> >                 return;<br>
<br>
-- <br>
Regards,<br>
<br>
Laurent Pinchart<br>
</blockquote></div>