History

avutil/pixdesc: ensure the component being read or writen to is valid

If depth is 0, then the component is invalid/unset.

James Almer committed 2 years ago

Commit 72f8f761 parent baa23e41 file · +6 −0Browse files

Unified · Split

libavutil/pixdesc.c+6−0
@@ -45,6 +45,9 @@ void av_read_image_line2(void *dst, · 44 unmodified lines
45 uint16_t *dst16 = dst;45 uint16_t *dst16 = dst;
46 uint32_t *dst32 = dst;46 uint32_t *dst32 = dst;
47 47
48 if (!depth)
49 return;
50
48 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {51 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
49 if (depth == 10) {52 if (depth == 10) {
50 // Assume all channels are packed into a 32bit value53 // 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 const uint32_t *src32 = src;127 const uint32_t *src32 = src;
125 const uint16_t *src16 = src;128 const uint16_t *src16 = src;
126 129
130 if (!depth)
131 return;
132
127 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {133 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
128 if (depth == 10) {134 if (depth == 10) {
129 // Assume all channels are packed into a 32bit value135 // Assume all channels are packed into a 32bit value

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t