Skip to content

Commit

Permalink
dav1d integer conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 7, 2024
1 parent 8657d35 commit 0e01eaa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libheif/plugins/decoder_dav1d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <cstring>
#include <cassert>
#include <cstdio>
#include <limits>
#include <utility>

#include <dav1d/version.h>
#include <dav1d/dav1d.h>
Expand Down Expand Up @@ -90,7 +92,13 @@ struct heif_error dav1d_new_decoder(void** dec)

dav1d_default_settings(&decoder->settings);

decoder->settings.frame_size_limit = heif_get_global_security_limits()->max_image_size_pixels;
if (std::cmp_greater(heif_get_global_security_limits()->max_image_size_pixels, std::numeric_limits<unsigned int>::max())) {
decoder->settings.frame_size_limit = 0;
}
else {
decoder->settings.frame_size_limit = static_cast<unsigned int>(heif_get_global_security_limits()->max_image_size_pixels);
}

decoder->settings.all_layers = 0;

if (dav1d_open(&decoder->context, &decoder->settings) != 0) {
Expand Down

0 comments on commit 0e01eaa

Please sign in to comment.