Mercurial > libavcodec.hg
comparison 8bps.c @ 2429:4b350cc506a7 libavcodec
Use avcodec_check_dimensions instead of custom hack
author | rtognimp |
---|---|
date | Sat, 15 Jan 2005 00:07:38 +0000 |
parents | 82af834636c2 |
children | d67740c88f86 |
comparison
equal
deleted
inserted
replaced
2428:548c87c06dbb | 2429:4b350cc506a7 |
---|---|
158 c->avctx = avctx; | 158 c->avctx = avctx; |
159 avctx->has_b_frames = 0; | 159 avctx->has_b_frames = 0; |
160 | 160 |
161 c->pic.data[0] = NULL; | 161 c->pic.data[0] = NULL; |
162 | 162 |
163 // FIXME: find a better way to prevent integer overflow | 163 if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) { |
164 if (((unsigned int)avctx->width > 32000) || ((unsigned int)avctx->height > 32000)) { | |
165 av_log(avctx, AV_LOG_ERROR, "Bad image size (w = %d, h = %d).\n", avctx->width, avctx->height); | 164 av_log(avctx, AV_LOG_ERROR, "Bad image size (w = %d, h = %d).\n", avctx->width, avctx->height); |
166 return 1; | 165 return 1; |
167 } | 166 } |
168 | 167 |
169 switch (avctx->bits_per_sample) { | 168 switch (avctx->bits_per_sample) { |