Commit 202aca67 authored by Michel Bardiaux's avatar Michel Bardiaux

Make sure some value is always returned via data_size

Originally committed as revision 12955 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 3b8c000d
......@@ -121,9 +121,8 @@ AVCodec libgsm_ms_encoder = {
static int libgsm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size) {
if(buf_size < avctx->block_align) return 0;
*data_size = 0; /* In case of error */
if(buf_size < avctx->block_align) return -1;
switch(avctx->codec_id) {
case CODEC_ID_GSM:
if(gsm_decode(avctx->priv_data,buf,data)) return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment