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
4545 uint16_t *dst16 = dst;
4646 uint32_t *dst32 = dst;
4747
48+ if (!depth)
49+ return;
50+
4851 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
4952 if (depth == 10) {
5053 // Assume all channels are packed into a 32bit value
@@ -124,6 +127,9 @@ void av_write_image_line2(const void *src, · 73 unmodified lines
124127 const uint32_t *src32 = src;
125128 const uint16_t *src16 = src;
126129
130+ if (!depth)
131+ return;
132+
127133 if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
128134 if (depth == 10) {
129135 // 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