mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-15 19:40:07 +01:00
avutil/pixdesc: ensure the component being read or writen to is valid
If depth is 0, then the component is invalid/unset. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -45,6 +45,9 @@ void av_read_image_line2(void *dst,
|
|||||||
uint16_t *dst16 = dst;
|
uint16_t *dst16 = dst;
|
||||||
uint32_t *dst32 = dst;
|
uint32_t *dst32 = dst;
|
||||||
|
|
||||||
|
if (!depth)
|
||||||
|
return;
|
||||||
|
|
||||||
if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
|
if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
|
||||||
if (depth == 10) {
|
if (depth == 10) {
|
||||||
// Assume all channels are packed into a 32bit value
|
// Assume all channels are packed into a 32bit value
|
||||||
@@ -124,6 +127,9 @@ void av_write_image_line2(const void *src,
|
|||||||
const uint32_t *src32 = src;
|
const uint32_t *src32 = src;
|
||||||
const uint16_t *src16 = src;
|
const uint16_t *src16 = src;
|
||||||
|
|
||||||
|
if (!depth)
|
||||||
|
return;
|
||||||
|
|
||||||
if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
|
if (flags & AV_PIX_FMT_FLAG_BITSTREAM) {
|
||||||
if (depth == 10) {
|
if (depth == 10) {
|
||||||
// Assume all channels are packed into a 32bit value
|
// Assume all channels are packed into a 32bit value
|
||||||
|
|||||||
Reference in New Issue
Block a user