File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -214,14 +214,17 @@ void LWAudioDecoder::GetAudioProperties(BSAudioProperties &AP) {
214
214
av_channel_layout_default (&ch, PropFrame->ch_layout .nb_channels );
215
215
AP.ChannelLayout = ch.u .mask ;
216
216
} else {
217
+ av_frame_free (&PropFrame);
217
218
throw BestSourceException (" Ambisonics and custom channel orders not supported" );
218
219
}
219
220
220
221
AP.NumSamples = (FormatContext->duration * PropFrame->sample_rate ) / AV_TIME_BASE - FormatContext->streams [TrackNumber]->codecpar ->initial_padding ;
221
222
if (PropFrame->pts != AV_NOPTS_VALUE)
222
223
AP.StartTime = (static_cast <double >(FormatContext->streams [TrackNumber]->time_base .num ) * PropFrame->pts ) / FormatContext->streams [TrackNumber]->time_base .den ;
223
224
224
- if (AP.AF .Bits <= 0 )
225
+ av_frame_free (&PropFrame);
226
+
227
+ if (AP.AF .Bits <= 0 ) // FIXME, can this still happen?
225
228
throw BestSourceException (" Codec returned zero size audio" );
226
229
}
227
230
Original file line number Diff line number Diff line change @@ -409,6 +409,8 @@ void LWVideoDecoder::GetVideoProperties(BSVideoProperties &VP) {
409
409
VP.Rotation += 360 ;
410
410
}
411
411
}
412
+
413
+ av_frame_free (&PropFrame);
412
414
}
413
415
414
416
AVFrame *LWVideoDecoder::GetNextFrame () {
You can’t perform that action at this time.
0 commit comments