Commit ef8cfd2
authored
Fix Deep Scanline Input crash when using a framebuffer as parameter (AcademySoftwareFoundation#2019)
* Fix Deep Scanline Input crash when using an externally allocated framebuffer
The Deep Scanline Input code has recently been rewritten to make use of the
EXR core library. As a result a bug was introduced when using the overloads of
readPixels() and readPixelSampleCounts() that use externally provided
framebuffers as parameters, a hard crash was occuring. According to the comment
on the header of these functions, when these overloads are used the InputFile's
frameBuffer is not used.
However both these functions call into readMemData(), which does use the
InputFile's member framebuffer, which has not been allocated, resulting into a
segmentation fault.
This commit fixes the above issue, by using the parameter framebuffer that is
passed in, which should be allocated by the caller application.
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
* Add a Deep Scanline Input test that uses a framebuffer parameter
After having found a bug with the readPixels() and readPixelSampleCounts()
overloads that receive a framebuffer parameter, it was made apparent that there
was a hole in our tests to cover these functions.
This commits slightly refactors the DeepScanLineBasic tests and adds a third
read path to add coverage for this case as well.
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>
---------
Signed-off-by: Nikolaos Koutsikos <nikolaos.koutsikos@foundry.com>1 parent d0e2e53 commit ef8cfd2
File tree
2 files changed
+43
-10
lines changed- src
- lib/OpenEXR
- test/OpenEXRTest
2 files changed
+43
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
246 | 253 | | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
250 | | - | |
| 257 | + | |
251 | 258 | | |
252 | 259 | | |
253 | 260 | | |
| |||
352 | 359 | | |
353 | 360 | | |
354 | 361 | | |
355 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
356 | 366 | | |
357 | | - | |
| 367 | + | |
358 | 368 | | |
359 | 369 | | |
360 | 370 | | |
| |||
397 | 407 | | |
398 | 408 | | |
399 | 409 | | |
| 410 | + | |
400 | 411 | | |
401 | 412 | | |
402 | 413 | | |
403 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
404 | 428 | | |
405 | 429 | | |
406 | 430 | | |
| |||
431 | 455 | | |
432 | 456 | | |
433 | 457 | | |
434 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
435 | 466 | | |
436 | 467 | | |
437 | 468 | | |
| |||
539 | 570 | | |
540 | 571 | | |
541 | 572 | | |
542 | | - | |
543 | | - | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
544 | 577 | | |
545 | 578 | | |
546 | 579 | | |
| |||
551 | 584 | | |
552 | 585 | | |
553 | 586 | | |
554 | | - | |
555 | | - | |
| 587 | + | |
| 588 | + | |
556 | 589 | | |
557 | 590 | | |
558 | 591 | | |
| |||
0 commit comments