diff mbox series

[FFmpeg-devel] lavc/exr: decode_block() fails when input resolution not exactly divisable by 8

Message ID 50391908-1EB0-45C8-A476-1609A645D0A4@gmail.com
State New
Headers show
Series [FFmpeg-devel] lavc/exr: decode_block() fails when input resolution not exactly divisable by 8 | expand

Checks

Context Check Description
andriy/configure_x86 warning Failed to apply patch

Commit Message

Sean Devonport July 23, 2024, 9:42 a.m. UTC
This stops decode_block() from failing when the .exr resolution is not divisable by 8 (e.g 108x192). The dc_w and dc_h needs to be round up and not down.

Signed-off-by: Sean Devonport <tonetechnician@gmail.com <mailto:tonetechnician@gmail.com>>
---
libavcodec/exr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 4bac0be89b..5df2c55609 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -987,8 +987,8 @@  static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
    int64_t version, lo_usize, lo_size;
    int64_t ac_size, dc_size, rle_usize, rle_csize, rle_raw_size;
    int64_t ac_count, dc_count, ac_compression;
-    const int dc_w = td->xsize >> 3;
-    const int dc_h = td->ysize >> 3;
+    const int dc_w = (td->xsize + 7) >> 3;
+    const int dc_h = (td->ysize + 7) >> 3;
    GetByteContext gb, agb;
    int skip, ret;