summaryrefslogtreecommitdiff
path: root/libavutil/pixdesc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-16 15:10:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-16 15:10:13 +0200
commit2d8a3cf4c168d528dfc41baa794d27d48ca4f273 (patch)
tree34e7559a538e8b8fd410ee687f0ec58236e9022d /libavutil/pixdesc.c
parentf807d6d2009b9f2e70d9a204a0e8b6140a87ec85 (diff)
avutil/pixdesc: check for component overlap
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/pixdesc.c')
-rw-r--r--libavutil/pixdesc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 39e7d6996f..9767cc1825 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1835,6 +1835,10 @@ void ff_check_pixfmt_descriptors(void){
for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
+ uint8_t fill[4][8+6+3] = {{0}};
+ uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
+ int linesize[4] = {0,0,0,0};
+ uint16_t tmp[2];
if (!d->name && !d->nb_components && !d->log2_chroma_w && !d->log2_chroma_h && !d->flags)
continue;
@@ -1857,6 +1861,10 @@ void ff_check_pixfmt_descriptors(void){
} else {
av_assert0(8*(c->step_minus1+1) >= c->depth_minus1+1);
}
+ av_read_image_line(tmp, (void*)data, linesize, d, 0, 0, j, 2, 0);
+ av_assert0(tmp[0] == 0 && tmp[1] == 0);
+ tmp[0] = tmp[1] = (1<<(c->depth_minus1 + 1)) - 1;
+ av_write_image_line(tmp, data, linesize, d, 0, 0, j, 2);
}
}
}