From e90820d4f815c15796e642467cdddbad755212a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 23 Jan 2013 21:38:41 +0200 Subject: [PATCH 1/2] rtp: Make sure priv_data is set before reading it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes crashes with muxing H263 into RTSP. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö --- libavformat/rtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtp.c b/libavformat/rtp.c index dfe97dec97..d1c6ed09aa 100644 --- a/libavformat/rtp.c +++ b/libavformat/rtp.c @@ -104,7 +104,7 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, for (i = 0; rtp_payload_types[i].pt >= 0; ++i) if (rtp_payload_types[i].codec_id == codec->codec_id) { if (codec->codec_id == AV_CODEC_ID_H263 && (!fmt || - !fmt->oformat->priv_class || + !fmt->oformat->priv_class || !fmt->priv_data || !av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190"))) continue; /* G722 has 8000 as nominal rate even if the sample rate is 16000, From 57ed8debb9b9cc565cc6e9f98c5b5cbb9f69097c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 23 Jan 2013 23:14:27 +0200 Subject: [PATCH 2/2] wmv2: Propagate the wmv2 idct permutation type to the dsputils context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes encoding where the idct setting originally was set to FF_IDCT_AUTO and dsputil chose a default idct with a non-null permutation - even if the permutation tables were updated, dct_quantize in x86/mpegvideoenc_template.c also checked the value of this type variable. Signed-off-by: Martin Storsjö --- libavcodec/wmv2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index dea3b3b67d..4420f494a6 100644 --- a/libavcodec/wmv2.c +++ b/libavcodec/wmv2.c @@ -29,6 +29,7 @@ av_cold void ff_wmv2_common_init(Wmv2Context * w){ MpegEncContext * const s= &w->s; ff_wmv2dsp_init(&w->wdsp); + s->dsp.idct_permutation_type = w->wdsp.idct_perm; ff_init_scantable_permutation(s->dsp.idct_permutation, w->wdsp.idct_perm); ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0],