diff options
author | wm4 <wm4@nowhere> | 2013-12-01 20:45:44 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-01 20:45:44 +0100 |
commit | f12ed5fd8f4d044ad245edf8b14c02f42638b73f (patch) | |
tree | 754e52b809297ac038a7029cf05e1923b0cbcc2a /video/img_format.h | |
parent | 317f2399a7aee5f1a0acd1db1d96595ceaa341a8 (diff) | |
download | mpv-f12ed5fd8f4d044ad245edf8b14c02f42638b73f.tar.bz2 mpv-f12ed5fd8f4d044ad245edf8b14c02f42638b73f.tar.xz |
mp_image: deal with FFmpeg PSEUDOPAL braindeath
We got a crash in libavutil when encoding with Y8 (GRAY8). The reason
was that libavutil was copying an Y8 image allocated by us, and expected
a palette. This is because GRAY8 is a PSEUDOPAL format. It's not clear
what PSEUDOPAL means, and it makes literally no sense at all. However,
it does expect a palette allocated for some formats that are not
paletted, and libavutil crashed when trying to access the non-existent
palette.
Diffstat (limited to 'video/img_format.h')
-rw-r--r-- | video/img_format.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/video/img_format.h b/video/img_format.h index 4d876304a0..5b75d87185 100644 --- a/video/img_format.h +++ b/video/img_format.h @@ -56,6 +56,13 @@ #define MP_IMGFLAG_BE 0x4000 // set if in native (host) endian, or endian independent #define MP_IMGFLAG_NE MP_SELECT_LE_BE(MP_IMGFLAG_LE, MP_IMGFLAG_BE) +// Carries a palette in plane[1] (see IMGFMT_PAL8 for format of the palette). +// Note that some non-paletted formats have this flag set, because FFmpeg +// mysteriously expects some formats to carry a palette plane for no apparent +// reason. FFmpeg developer braindeath? +// The only real paletted format we support is IMGFMT_PAL8, so check for that +// format directly if you want an actual paletted format. +#define MP_IMGFLAG_PAL 0x8000 // Exactly one of these bits is set in mp_imgfmt_desc.flags #define MP_IMGFLAG_COLOR_CLASS_MASK \ |