If depth is 0, then the component is invalid/unset.
Unified · Split
| @@ -45,6 +45,9 @@ void av_read_image_line2(void *dst, · 44 unmodified lines | ||
| 45 | 45 | uint16_t *dst16 = dst; |
| 46 | 46 | uint32_t *dst32 = dst; |
| 47 | 47 | |
| 48 | + if (!depth) | |
| 49 | + return; | |
| 50 | + | |
| 48 | 51 | if (flags & AV_PIX_FMT_FLAG_BITSTREAM) { |
| 49 | 52 | if (depth == 10) { |
| 50 | 53 | // Assume all channels are packed into a 32bit value |
| @@ -124,6 +127,9 @@ void av_write_image_line2(const void *src, · 73 unmodified lines | ||
| 124 | 127 | const uint32_t *src32 = src; |
| 125 | 128 | const uint16_t *src16 = src; |
| 126 | 129 | |
| 130 | + if (!depth) | |
| 131 | + return; | |
| 132 | + | |
| 127 | 133 | if (flags & AV_PIX_FMT_FLAG_BITSTREAM) { |
| 128 | 134 | if (depth == 10) { |
| 129 | 135 | // Assume all channels are packed into a 32bit value |