[FFmpeg-devel] [PATCH 2/8] png: Don't fail when a packet is larger than INT_MAX
Michael Niedermayer
michaelni at gmx.at
Sun Mar 29 17:48:12 CEST 2015
On Sun, Mar 29, 2015 at 11:05:41AM +0000, Donny Yang wrote:
> Signed-off-by: Donny Yang <work at kota.moe>
> ---
> libavcodec/pngenc.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
> index 3697dbb..bd3aae5 100644
> --- a/libavcodec/pngenc.c
> +++ b/libavcodec/pngenc.c
> @@ -373,8 +373,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> enc_row_size +
> 12 * (((int64_t)enc_row_size + IOBUF_SIZE - 1) / IOBUF_SIZE) // 12 * ceil(enc_row_size / IOBUF_SIZE)
> );
> - if (max_packet_size > INT_MAX)
> - return AVERROR(ENOMEM);
the check is neccessary to prevent potential integer overflows
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150329/97efa215/attachment.asc>
More information about the ffmpeg-devel
mailing list