Mercurial > libavcodec.hg
comparison imgresample.c @ 2422:18b8b2dcc037 libavcodec
various security fixes and precautionary checks
author | michael |
---|---|
date | Wed, 12 Jan 2005 00:16:25 +0000 |
parents | 17ec73c65748 |
children | 87b7fbed8609 |
comparison
equal
deleted
inserted
replaced
2421:e326490f58c4 | 2422:18b8b2dcc037 |
---|---|
558 { | 558 { |
559 ImgReSampleContext *s; | 559 ImgReSampleContext *s; |
560 | 560 |
561 s = av_mallocz(sizeof(ImgReSampleContext)); | 561 s = av_mallocz(sizeof(ImgReSampleContext)); |
562 if (!s) | 562 if (!s) |
563 return NULL; | |
564 if((unsigned)owidth >= UINT_MAX / (LINE_BUF_HEIGHT + NB_TAPS)) | |
563 return NULL; | 565 return NULL; |
564 s->line_buf = av_mallocz(owidth * (LINE_BUF_HEIGHT + NB_TAPS)); | 566 s->line_buf = av_mallocz(owidth * (LINE_BUF_HEIGHT + NB_TAPS)); |
565 if (!s->line_buf) | 567 if (!s->line_buf) |
566 goto fail; | 568 goto fail; |
567 | 569 |