summaryrefslogtreecommitdiff
path: root/libavcodec/dfa.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-29 15:24:33 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-29 15:34:22 +0200
commit6fcd4f3c7255014eeb883385d32abc7442426314 (patch)
tree3bc60731b4dd02cf55f0dba6c87f519d61e7df9f /libavcodec/dfa.c
parentb96dc093eaf3adaf5df80559cbbaba00d1708adf (diff)
dfa: replace redundant check by assert
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>
Diffstat (limited to 'libavcodec/dfa.c')
-rw-r--r--libavcodec/dfa.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index 7336e8cb4f..e4b940cc60 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/avassert.h"
#include "avcodec.h"
#include "bytestream.h"
@@ -36,12 +37,13 @@ typedef struct DfaContext {
static av_cold int dfa_decode_init(AVCodecContext *avctx)
{
DfaContext *s = avctx->priv_data;
- int ret;
avctx->pix_fmt = PIX_FMT_PAL8;
- if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
- return ret;
+ if (!avctx->width || !avctx->height)
+ return AVERROR_INVALIDDATA;
+
+ av_assert0(av_image_check_size(avctx->width, avctx->height, 0, avctx) >= 0);
s->frame_buf = av_mallocz(avctx->width * avctx->height + AV_LZO_OUTPUT_PADDING);
if (!s->frame_buf)