Commit e8a06b14 authored by Stefano Sabatini's avatar Stefano Sabatini

lavf/4xm: use proper error codes

parent 2cbe9121
...@@ -169,7 +169,7 @@ static int fourxm_read_header(AVFormatContext *s) ...@@ -169,7 +169,7 @@ static int fourxm_read_header(AVFormatContext *s)
current_track = AV_RL32(&header[i + 8]); current_track = AV_RL32(&header[i + 8]);
if((unsigned)current_track >= UINT_MAX / sizeof(AudioTrack) - 1){ if((unsigned)current_track >= UINT_MAX / sizeof(AudioTrack) - 1){
av_log(s, AV_LOG_ERROR, "current_track too large\n"); av_log(s, AV_LOG_ERROR, "current_track too large\n");
ret= -1; ret = AVERROR_INVALIDDATA;
goto fail; goto fail;
} }
if (current_track + 1 > fourxm->track_count) { if (current_track + 1 > fourxm->track_count) {
...@@ -193,7 +193,7 @@ static int fourxm_read_header(AVFormatContext *s) ...@@ -193,7 +193,7 @@ static int fourxm_read_header(AVFormatContext *s)
|| fourxm->tracks[current_track].sample_rate <= 0 || fourxm->tracks[current_track].sample_rate <= 0
|| fourxm->tracks[current_track].bits < 0){ || fourxm->tracks[current_track].bits < 0){
av_log(s, AV_LOG_ERROR, "audio header invalid\n"); av_log(s, AV_LOG_ERROR, "audio header invalid\n");
ret= -1; ret = AVERROR_INVALIDDATA;
goto fail; goto fail;
} }
i += 8 + size; i += 8 + size;
......
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