diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2011-10-21 12:39:53 -0700 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2011-10-21 12:39:53 -0700 |
commit | 04d90d093f6e552c8c0c77f8d4a08344c77a4fca (patch) | |
tree | d60c9c0c1d29b101bf828d01ea44abe580c8d756 /android/camera | |
parent | cdd8d78b202e005691467296b9be98816ed4d4a9 (diff) | |
download | external_qemu-04d90d093f6e552c8c0c77f8d4a08344c77a4fca.zip external_qemu-04d90d093f6e552c8c0c77f8d4a08344c77a4fca.tar.gz external_qemu-04d90d093f6e552c8c0c77f8d4a08344c77a4fca.tar.bz2 |
Bound loop index
In some cases (when frame sizes for pixel formats are not available) the loop will
be not properly bounded, and may cause a crash.
Change-Id: I2f2380ab4e2f7454bff8eeabcaff4e3f238fe71e
Diffstat (limited to 'android/camera')
-rw-r--r-- | android/camera/camera-capture-linux.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/android/camera/camera-capture-linux.c b/android/camera/camera-capture-linux.c index 32d8b0c..b9a4227 100644 --- a/android/camera/camera-capture-linux.c +++ b/android/camera/camera-capture-linux.c @@ -700,7 +700,7 @@ _camera_device_enum_pixel_formats(LinuxCameraDevice* cd, QemuPixelFormat** fmts) } arr = *fmts; memset(arr, 0, fmt_num * sizeof(QemuPixelFormat)); - for (n = 0; out_num < fmt_num; n++) { + for (n = 0; n < fmt_num && out_num < fmt_num; n++) { fmt_enum.index = n; fmt_enum.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(_xioctl(cd->handle, VIDIOC_ENUM_FMT, &fmt_enum)) { |