summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavutil/imgutils.c
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-09-30 10:40:30 -0500
committertrav90 <travawine@palemoon.org>2018-09-30 10:40:30 -0500
commitedc124b92beccd55e5277062e95efb62a8b3ec7b (patch)
tree3486b32f85152ff76b1bee03a8d84b3c34c70a5f /media/ffvpx/libavutil/imgutils.c
parent8ba6dd1bd12a3d13f9e2c683216dd8778011a72e (diff)
downloadUXP-edc124b92beccd55e5277062e95efb62a8b3ec7b.tar
UXP-edc124b92beccd55e5277062e95efb62a8b3ec7b.tar.gz
UXP-edc124b92beccd55e5277062e95efb62a8b3ec7b.tar.lz
UXP-edc124b92beccd55e5277062e95efb62a8b3ec7b.tar.xz
UXP-edc124b92beccd55e5277062e95efb62a8b3ec7b.zip
[ffvpx] Update ffvp9/ffvp8 to release 4.0.2
Diffstat (limited to 'media/ffvpx/libavutil/imgutils.c')
-rw-r--r--media/ffvpx/libavutil/imgutils.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/media/ffvpx/libavutil/imgutils.c b/media/ffvpx/libavutil/imgutils.c
index 500517880..4938a7ef6 100644
--- a/media/ffvpx/libavutil/imgutils.c
+++ b/media/ffvpx/libavutil/imgutils.c
@@ -125,7 +125,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei
size[0] = linesizes[0] * height;
if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
- desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
+ desc->flags & FF_PSEUDOPAL) {
data[1] = ptr + size[0]; /* palette is stored here as 256 32 bits words */
return size[0] + 256 * 4;
}
@@ -216,7 +216,7 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
av_free(buf);
return ret;
}
- if (desc->flags & AV_PIX_FMT_FLAG_PAL || desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
+ if (desc->flags & AV_PIX_FMT_FLAG_PAL || (desc->flags & FF_PSEUDOPAL && pointers[1])) {
avpriv_set_systematic_pal2((uint32_t*)pointers[1], pix_fmt);
if (align < 4) {
av_log(NULL, AV_LOG_ERROR, "Formats with a palette require a minimum alignment of 4\n");
@@ -225,7 +225,7 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
}
if ((desc->flags & AV_PIX_FMT_FLAG_PAL ||
- desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) &&
+ desc->flags & FF_PSEUDOPAL) && pointers[1] &&
pointers[1] - pointers[0] > linesizes[0] * h) {
/* zero-initialize the padding before the palette */
memset(pointers[0] + linesizes[0] * h, 0,
@@ -242,9 +242,10 @@ typedef struct ImgUtils {
} ImgUtils;
static const AVClass imgutils_class = {
- .class_name = "IMGUTILS",
- .item_name = av_default_item_name,
- .version = LIBAVUTIL_VERSION_INT,
+ .class_name = "IMGUTILS",
+ .item_name = av_default_item_name,
+ .option = NULL,
+ .version = LIBAVUTIL_VERSION_INT,
.log_level_offset_offset = offsetof(ImgUtils, log_offset),
.parent_log_context_offset = offsetof(ImgUtils, log_ctx),
};
@@ -353,12 +354,13 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4],
return;
if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
- desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL) {
+ desc->flags & FF_PSEUDOPAL) {
copy_plane(dst_data[0], dst_linesizes[0],
src_data[0], src_linesizes[0],
width, height);
/* copy the palette */
- memcpy(dst_data[1], src_data[1], 4*256);
+ if ((desc->flags & AV_PIX_FMT_FLAG_PAL) || (dst_data[1] && src_data[1]))
+ memcpy(dst_data[1], src_data[1], 4*256);
} else {
int i, planes_nb = 0;
@@ -441,7 +443,7 @@ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt,
return ret;
// do not include palette for these pseudo-paletted formats
- if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
+ if (desc->flags & FF_PSEUDOPAL)
return FFALIGN(width, align) * height;
return av_image_fill_arrays(data, linesize, NULL, pix_fmt,