Most decoders return the amount of data used.
This is more consistent
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This fixes a heap-buffer-overflow detected by AddressSanitizer.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Libav, for some reason, merged this as a public API function. This will
aid in future merges.
A define is left for backwards compat, just in case some person
used it, since it is in a public header.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
If we do check av_pix_fmt_desc_get() then we should fail and
not continue with an invalid pix_fmt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avctx->coded_frame is not used for decoders anymore,
and av_frame_alloc does all the frame initialization required.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes out of array access
If some valid files fail this check then please open a ticket and ping me and the smvjpegdec maintainer.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>