[aravis/aravis-0-2] camera: fix a possible NULL dereference crash.



commit b0189790e6aee66da765694d68e991318121d820
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Sat Nov 16 17:31:38 2013 +0100

    camera: fix a possible NULL dereference crash.
    
    It would happen if either minimum or maximum placeholder is NULL, and
    using a The Imagning Source camera.

 src/arvcamera.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/arvcamera.c b/src/arvcamera.c
index 99bbb80..ae79217 100644
--- a/src/arvcamera.c
+++ b/src/arvcamera.c
@@ -753,9 +753,9 @@ arv_camera_get_frame_rate_bounds (ArvCamera *camera, double *min, double *max)
 
                                                s = (int)((10000000/(double) values[i]) * 100 + 0.5) / 100.0;
 
-                                               if (s > *max && max != NULL)
+                                               if (max != NULL && s > *max)
                                                        *max = s;
-                                               if ((*min == 0 || *min > s) && min != NULL)
+                                               if (min != NULL && (*min == 0 || *min > s))
                                                        *min = s;
                                        }
                                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]