Browse Source

Make faac_decode_frame return -1 on error and not 0 which avoids

stalling and infinite loop.
Patch by Baptiste COUDURIER <baptiste coudurier at smartjog com>

Originally committed as revision 5110 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Baptiste Coudurier Måns Rullgård 19 years ago
parent
commit
980bbb13d6
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/faad.c

+ 2
- 2
libavcodec/faad.c View File

@@ -164,7 +164,7 @@ static int faac_decode_frame(AVCodecContext *avctx,
if(r < 0){ if(r < 0){
av_log(avctx, AV_LOG_ERROR, "faac: codec init failed: %s\n", av_log(avctx, AV_LOG_ERROR, "faac: codec init failed: %s\n",
s->faacDecGetErrorMessage(frame_info.error)); s->faacDecGetErrorMessage(frame_info.error));
return 0;
return -1;
} }
avctx->sample_rate = srate; avctx->sample_rate = srate;
avctx->channels = channels; avctx->channels = channels;
@@ -176,7 +176,7 @@ static int faac_decode_frame(AVCodecContext *avctx,
if (frame_info.error > 0) { if (frame_info.error > 0) {
av_log(avctx, AV_LOG_ERROR, "faac: frame decoding failed: %s\n", av_log(avctx, AV_LOG_ERROR, "faac: frame decoding failed: %s\n",
s->faacDecGetErrorMessage(frame_info.error)); s->faacDecGetErrorMessage(frame_info.error));
return 0;
return -1;
} }


frame_info.samples *= s->sample_size; frame_info.samples *= s->sample_size;


Loading…
Cancel
Save