avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 3 Oct 2014 15:35:58 +0000 (17:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Oct 2014 12:20:32 +0000 (14:20 +0200)
commit64be1a45eb2604deca259319780ce02bd921859b
tree2a19345fc35a2e6d3cf3f6bb06c5e6a207d46526
parentf8bd98ae4d691fa7405856d83ca3d304429cc6f0
avcodec/pngdec: Check bits per pixel before setting monoblack pixel format

Fixes out of array accesses
Fixes: asan_heap-oob_14dbfcf_4_asan_heap-oob_1ce5767_179_add_method_small.png

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3e2b745020c2dbf0201fe7df3dad9e7e0b2e1bb6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pngdec.c