diff --git a/torchvision/csrc/io/image/cpu/exif.h b/torchvision/csrc/io/image/cpu/exif.h index 700cd60765e..0f9a59417db 100644 --- a/torchvision/csrc/io/image/cpu/exif.h +++ b/torchvision/csrc/io/image/cpu/exif.h @@ -215,6 +215,7 @@ inline int fetch_png_exif_orientation(png_structp png_ptr, png_infop info_ptr) { if (exif && num_exif > 0) { return fetch_exif_orientation(exif, num_exif); } + return -1; } #else // #if PNG_FOUND && defined(PNG_eXIf_SUPPORTED) inline int fetch_png_exif_orientation(png_structp png_ptr, png_infop info_ptr) {