The values are checked in the wraper function used to call this code.
This was introduced by: ee715f49a06bf3898246d01b056284a9bb1bcbb9
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -20,6 +20,7 @@ |
20 | 20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 | 21 |
*/ |
22 | 22 |
|
23 |
+#include "libavutil/avassert.h" |
|
23 | 24 |
#include "avcodec.h" |
24 | 25 |
#include "bytestream.h" |
25 | 26 |
|
... | ... |
@@ -36,12 +37,13 @@ typedef struct DfaContext { |
36 | 36 |
static av_cold int dfa_decode_init(AVCodecContext *avctx) |
37 | 37 |
{ |
38 | 38 |
DfaContext *s = avctx->priv_data; |
39 |
- int ret; |
|
40 | 39 |
|
41 | 40 |
avctx->pix_fmt = PIX_FMT_PAL8; |
42 | 41 |
|
43 |
- if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0) |
|
44 |
- return ret; |
|
42 |
+ if (!avctx->width || !avctx->height) |
|
43 |
+ return AVERROR_INVALIDDATA; |
|
44 |
+ |
|
45 |
+ av_assert0(av_image_check_size(avctx->width, avctx->height, 0, avctx) >= 0); |
|
45 | 46 |
|
46 | 47 |
s->frame_buf = av_mallocz(avctx->width * avctx->height + AV_LZO_OUTPUT_PADDING); |
47 | 48 |
if (!s->frame_buf) |