Commit Graph

12190 Commits

Author SHA1 Message Date
Marcus Meissner
dae0ec028d convert malloc (overflowing mult) to calloc(x,y) that handles this internally 2022-11-21 16:44:03 +01:00
Marcus Meissner
b7dbae2daa fixed missing arguments in 2 debug functions, spotted by codeql 2022-11-21 16:30:03 +01:00
Marcus Meissner
fcf4fe2e30 try to fix codeql integer expansion warning 2022-11-21 16:28:40 +01:00
Marcus Meissner
c3fdd091a3 fix some CodeQL warnings 2022-11-21 16:25:58 +01:00
Mark Watson
016821ea11 Add 2 new settings metadata for Sony A7R3 (#872)
* Add support for Sony 'Live Display: Setting Effect ON/OFF'.

This setting toggles exposure preview on the live view / preview image.

* Add support for Sony A7R3/A7R3A 'Focus Area' settings.

Co-authored-by: Mark Watson <watsonmw@gmai.com>
2022-11-19 10:39:01 +01:00
Marcus Meissner
3f1a37d280 try to fix 4 codeql warnings 2022-11-16 16:12:34 +01:00
Hans Ulrich Niedermann
8462af5e3b SECURITY.md: Link to Github private vulnerability reporting 2022-11-16 14:55:25 +01:00
Hans Ulrich Niedermann
c6ea54c954 ci: Add Cirrus CI build for FreeBSD
Add a CI build for FreeBSD using Cirrus CI.

We can use Github Workflow for Linux, macOS, and Windows.
2022-11-14 13:23:48 +01:00
Hans Ulrich Niedermann
4dd0f3a322 ci: Add CI build for macOS
Note that this skips the 'make distcheck' stage due to two reasons:

  * GitHub considers macOS cpu cycles to be very expensive, and
    distcheck basically doubles the build cycles
  * For reasons yet unknown, 'make distcheck' on macOS fails with
    the compiler being unable to create an executable.
2022-11-14 10:36:23 +01:00
Hans Ulrich Niedermann
b361f8f719 ci: Add comment pointing to actionlint
If Github does not accept a workflow YAML file as intended,
actionlint is a very useful tool to help find out what is
wrong in the YAML file.
2022-11-13 17:26:33 +01:00
Hans Ulrich Niedermann
70e5b60e77 ci: Rename CI build 2022-11-13 17:26:33 +01:00
Hans Ulrich Niedermann
ee895a1ff3 ci: Prepare for OS specific build flags 2022-11-13 17:26:31 +01:00
Hans Ulrich Niedermann
2154998cb9 ci: Update step names 2022-11-13 17:24:33 +01:00
Hans Ulrich Niedermann
090d8a10da ci: Prepare for portable concurrent make 2022-11-13 17:24:31 +01:00
Hans Ulrich Niedermann
000d5b9408 ci: Add global LC_ALL and COMMON_CONFIGURE_FLAGS 2022-11-13 17:23:04 +01:00
Hans Ulrich Niedermann
6ce8e19649 ci: Update indentation and quote names 2022-11-11 14:31:36 +01:00
Hans Ulrich Niedermann
6b595a34ad Define main function as "int main(void)" (with void) 2022-11-11 09:55:40 +01:00
Hans Ulrich Niedermann
bc8eb3b684 gh workflow: Update to actions/checkout@v3 2022-11-09 19:49:20 +01:00
Hans Ulrich Niedermann
2cc8be403e Use per-program "noinst_PROGRAMS +=" line 2022-11-09 17:17:04 +01:00
Hans Ulrich Niedermann
8f035e3038 Using _LDFLAGS for libs is wrong, use _LDADD 2022-11-09 17:03:56 +01:00
Gergely Erdélyi
9bdae2ab1e Add support for Fujifilm X-H2 (#861)
Preview and image capture work in both USB TETHER SHOOTING AUTO & FIXED
modes.
2022-11-08 09:56:38 +01:00
Li kunyu
ba753c8a2d docupen: Remove redundant semicolons
Signed-off-by: Li kunyu <kunyu@nfschina.com>
2022-11-07 11:40:38 +01:00
Marcus Meissner
13b6d6b65e add a --disable-debug test too 2022-11-07 09:32:13 +01:00
Marcus Meissner
c03aa04db0 always build gpi_vsnprintf, as we use it unconditionally in libgphoto2
fixes https://github.com/gphoto/libgphoto2/issues/174
2022-11-07 09:19:35 +01:00
Marcus Meissner
3067c978af Wrap unsafe libltdl calls with locking (#848)
* Wrap unsafe libltdl calls with locking

https://github.com/gphoto/libgphoto2/issues/166

* 848: do not install internal header gphoto2-port-mutex.h

* 848: wrap symbol declarations in #ifdef _GPHOTO2_INTERNAL_CODE

* 848: Use proper include guard macro

* 848: Encapsulate the lock/unlock code inside functions

This hides the pthread usage as an implementation detail inside the
gpi_libltdl_lock() and gpi_libltdl_unlock() functions.

* 848: Rename from *-mutex.[ch] to *-locking.[ch]

The *-lock.[ch] name is implementation neutral.

* 848: update libgphoto2_port version number

* 848: internal headers do not require __cplusplus checks

* 848: add copyright comment at the beginning of *.[ch]

* 848: add an unlocked variant of gp_abilities_list_load_dir to avoid lots of unlock/lock codes

* 848: remove unnecessary whitespace addition

Co-authored-by: kadler15 <spurfan15@gmail.com>
Co-authored-by: Hans Ulrich Niedermann <hun@n-dimensional.de>
2022-11-05 09:43:06 +01:00
Marcus Meissner
48136a6809 added NEWS 2022-10-24 17:32:40 +02:00
Sebastian Rasmussen
3cc9ddb121 updated svensk 2022-10-24 17:32:40 +02:00
Hans Ulrich Niedermann
23582df0f4 "Writing shared libraries" URL is available again
Mike Hearn's "Writing shared libraries" is available again at

    https://plan99.net/~mike/writing-shared-libraries.html

Thanks, Mike!
2022-10-15 19:42:46 +02:00
Hans Ulrich Niedermann
a0204d6ba7 Find working URL for "Writing shared libraries"
Find a working URL for "Writing shared libraries" by Mike Hearn
2022-10-15 15:10:39 +02:00
Marcus Meissner
0aea074ab6 free storedevents after use 2022-10-12 20:37:13 +02:00
Omri Sarig
d2e3fef8e0 Fix pointer issues in local PTP event queue in Nikon capture (#849)
https://github.com/gphoto/libgphoto2/issues/846

Co-authored-by: Omri Sarig <omri.sarig@prevas.dk>
2022-10-11 18:51:16 +02:00
Hans Ulrich Niedermann
680be84eeb bs: forbid unexapanded LT_ macros in configure 2022-10-11 16:39:20 +02:00
Marcus Meissner
540762d91f use a local PTP event queue in nikon capture to avoid checking interrupts on any event,
which causes delays.

https://github.com/gphoto/libgphoto2/issues/846
2022-10-10 17:02:34 +02:00
Marcus Meissner
e0e4da2d5c filter out more commands on the Nikon S1. https://github.com/gphoto/libgphoto2/issues/845 2022-10-03 10:45:08 +02:00
Marcus Meissner
0c28822d59 Hide all the fuzzing code behind a ifdef FUZZING
https://github.com/gphoto/libgphoto2/issues/842
2022-09-29 09:55:38 +02:00
Li kunyu
cd31ed1359 Optimize some code statements (#844)
* ptp2/config: remove a semicolon

Signed-off-by: Li kunyu <kunyu@nfschina.com>

* docupen: remove a semicolon

Signed-off-by: Li kunyu <kunyu@nfschina.com>

* ax203: remove a semicolon

Signed-off-by: Li kunyu <kunyu@nfschina.com>

Signed-off-by: Li kunyu <kunyu@nfschina.com>
2022-09-29 09:32:50 +02:00
Ingvar Stepanyan
f34898a0d8 Fix building virtual camera on macOS (#843)
Like ac4546e0dd and https://github.com/gphoto/libgphoto2/pull/615, but for virtual camera too.
2022-09-29 09:24:00 +02:00
Marcus Meissner
e34e69bfa5 some Canons have an enum from 0-3 for the battery level instead of going from 0 to 100.
Detect and handle this case. (fixes https://github.com/gphoto/gphoto2/issues/541)
2022-09-28 17:48:10 +02:00
Marcus Meissner
7605d4ab2b remove noisy warning in non-fuzz mode. fixes https://github.com/gphoto/libgphoto2/issues/842 2022-09-28 09:40:20 +02:00
Marcus Meissner
8b462f8c83 use the correct error handling method (C_PTP instead of CR)
restore timeout before returning

fixes https://github.com/gphoto/libgphoto2/issues/835
2022-09-27 10:50:37 +02:00
Ingvar Stepanyan
fb2b128353 Unify & fix file reading in vcamera (#841)
`read` can (and, in my case, did) return partial result instead of reading the whole number of bytes provided, leading to errors.

I replaced `open` / `read` with `fopen` / `fread` instead, which don't suffer from this issue, as well as extracted into a helper function.
2022-09-26 16:43:07 +02:00
Marcus Meissner
c387e6be11 remove duplicate code, add some comments
https://github.com/gphoto/libgphoto2/issues/835
2022-09-26 13:58:28 +02:00
Ingvar Stepanyan
a3bd587689 Allow customizing vcamera directory at runtime (#840)
- Consumers won't have to guess the path (which depends on the version of the library).
 - Consumers don't have to have access to the path (/usr/share/...) might be readonly to them.
 - Consumer can point VCAMERADIR to a temporary directory, ensuring a clean slate before each test.
2022-09-26 12:47:02 +02:00
Ingvar Stepanyan
ba6c270e40 Fix couple of leaks in virtual camera (#839) 2022-09-26 11:49:02 +02:00
Marcus Meissner
b805dc6419 repotr PTP_RC_StoreNotAvailable during capture if we have no image 2022-09-26 10:06:48 +02:00
Ingvar Stepanyan
e465cb4ac8 Zero-fill CameraFileInfo (#838)
I've noticed in my tests that for many files the CameraFileInfo incorrectly had `info.audio` marked as available (with various flags).

Thanks to valgrind I found that it's because `CameraFileInfo` is zero-filled in some places, but not others, so the `audio.fields` (as well as entire `audio`) was filled with uninitialized data.

I tried to find all usages of `info.file.fields = ...` and `info.preview.fields = ...` and zero-initialize them in the same way as it already is in other places.
2022-09-26 09:07:17 +02:00
Ingvar Stepanyan
0a87bb875f Remove printf leftover (#836)
I noticed this in my logs and... according to Git blame it's been there for over 21 years? 😂
2022-09-26 09:05:25 +02:00
Marcus Meissner
cf154a3d81 report storereadonly instead of generalerror, as generalerror is ignored in our ptp stack.
https://github.com/gphoto/libgphoto2/issues/835
2022-09-24 09:10:47 +02:00
Marcus Meissner
3d038b9080 added eos r7 debug 2022-09-21 11:24:24 +02:00
Marcus Meissner
08cdbe6a9d added canon eos r7 https://github.com/gphoto/libgphoto2/issues/832 2022-09-21 11:11:07 +02:00