qtdemux: guard against bogus atom sizes and short reads
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 29 Jun 2009 17:58:33 +0000 (18:58 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 1 Jul 2009 08:24:38 +0000 (09:24 +0100)
commit405aae4568bbc8e3fa1c6975dc97425418dfe71a
treeaadd5c978e980efefc53b960d38035ecbb8b5de8
parentc730912f67a04e67c71c3d25dfa0852ab671a2d7
qtdemux: guard against bogus atom sizes and short reads

Check the possibly 64-bit atom size more carefully before casting it
to an int and passing it to gst_pad_pull_range(), otherwise we might
end up pulling 0 bytes, getting an empty buffer as requested and
dereferencing not available data whilst thinking we actually asked
for and got 0x1000000000000 bytes. Similar fix for push mode operation
where neededbytes ends up being 0 bytes, which makes us assert. Fixes
crash with broken or fuzzed file (NB #122378).
gst/qtdemux/qtdemux.c