Revision 8bb7d97b libavformat/4xm.c

View differences:

libavformat/4xm.c
185 185
            fourxm->tracks[current_track].sample_rate = AV_RL32(&header[i + 40]);
186 186
            fourxm->tracks[current_track].bits        = AV_RL32(&header[i + 44]);
187 187
            fourxm->tracks[current_track].audio_pts   = 0;
188
            if(   fourxm->tracks[current_track].channels    <= 0
189
               || fourxm->tracks[current_track].sample_rate <= 0
190
               || fourxm->tracks[current_track].bits        <  0){
191
                av_log(s, AV_LOG_ERROR, "audio header invalid\n");
192
                ret= -1;
193
                goto fail;
194
            }
188 195
            i += 8 + size;
189 196

  
190 197
            /* allocate a new AVStream */
......
291 298
            out_size= get_le32(pb);
292 299
            size-=8;
293 300

  
294
            if (track_number < fourxm->track_count) {
301
            if (track_number < fourxm->track_count && fourxm->tracks[track_number].channels>0) {
295 302
                ret= av_get_packet(s->pb, pkt, size);
296 303
                if(ret<0)
297 304
                    return AVERROR(EIO);

Also available in: Unified diff