Mercurial > libavcodec.hg
comparison qdm2.c @ 3158:5b2a0e54dfa7 libavcodec
fix infinite loop
author | michael |
---|---|
date | Thu, 02 Mar 2006 21:47:53 +0000 |
parents | 50d80b04f150 |
children | 888e539459f4 |
comparison
equal
deleted
inserted
replaced
3157:58dc6ca8c92d | 3158:5b2a0e54dfa7 |
---|---|
2006 void *data, int *data_size, | 2006 void *data, int *data_size, |
2007 uint8_t *buf, int buf_size) | 2007 uint8_t *buf, int buf_size) |
2008 { | 2008 { |
2009 QDM2Context *s = avctx->priv_data; | 2009 QDM2Context *s = avctx->priv_data; |
2010 | 2010 |
2011 if((buf == NULL) || (buf_size < s->checksum_size)) | 2011 if(!buf) |
2012 return 0; | 2012 return 0; |
2013 if(buf_size < s->checksum_size) | |
2014 return -1; | |
2013 | 2015 |
2014 *data_size = s->channels * s->frame_size * sizeof(int16_t); | 2016 *data_size = s->channels * s->frame_size * sizeof(int16_t); |
2015 | 2017 |
2016 av_log(avctx, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n", | 2018 av_log(avctx, AV_LOG_DEBUG, "decode(%d): %p[%d] -> %p[%d]\n", |
2017 buf_size, buf, s->checksum_size, data, *data_size); | 2019 buf_size, buf, s->checksum_size, data, *data_size); |