From adc214e6797750285a5e62634b8521db521162ad Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Thu, 18 Dec 2014 12:20:11 +0200 Subject: rtpenc: Avoid brittle switch fallthroughs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead explicitly jump to the default case in the cases where it is wanted, and avoid fallthrough between different codecs, which could easily introduce bugs if people editing the code aren't careful. Signed-off-by: Martin Storsjö --- libavformat/rtpenc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat') diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index dafe3a0a70..e5dc8057f9 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -255,8 +255,11 @@ static int rtp_write_header(AVFormatContext *s1) av_log(s1, AV_LOG_ERROR, "Only mono is supported\n"); goto fail; } + s->num_frames = 0; + goto defaultcase; case AV_CODEC_ID_AAC: s->num_frames = 0; + goto defaultcase; default: defaultcase: if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { -- cgit v1.2.3