File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -505,6 +505,11 @@ static int ReadDescChunk( demux_t *p_demux )
505
505
return VLC_EGENERIC ;
506
506
507
507
p_sys -> fmt .audio .i_rate = (unsigned int )lround ( d_rate );
508
+ if ( !p_sys -> fmt .audio .i_rate )
509
+ {
510
+ msg_Err ( p_demux , "Sample rate must be non-zero" );
511
+ return VLC_EGENERIC ;
512
+ }
508
513
p_sys -> fmt .audio .i_channels = i_channels_per_frame ;
509
514
p_sys -> fmt .audio .i_bytes_per_frame = i_bytes_per_packet ; /* "mBytesPerPacket" in Apple parlance */
510
515
p_sys -> fmt .audio .i_frame_length = i_frames_per_packet ; /* "mFramesPerPacket" in Apple parlance */
@@ -884,7 +889,7 @@ static int Open( vlc_object_t *p_this )
884
889
i_idx ++ ;
885
890
}
886
891
887
- if ( !p_sys -> i_data_offset || p_sys -> fmt .i_cat != AUDIO_ES ||
892
+ if ( !p_sys -> i_data_offset || p_sys -> fmt .i_cat != AUDIO_ES || ! p_sys -> fmt . audio . i_rate ||
888
893
( NeedsPacketTable ( p_sys ) && !p_sys -> packet_table .i_descriptions_start ))
889
894
{
890
895
msg_Err ( p_demux , "Did not find all necessary chunks." );
You can’t perform that action at this time.
0 commit comments