[FFmpeg-cvslog] swr: check that the context for swr_convert() has been initialized

Michael Niedermayer git at videolan.org
Mon Feb 24 08:39:00 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Feb 22 22:29:51 2014 +0100| [6c6e4dd139159a7dbf1b85f583804b6334ad88c1] | committer: Michael Niedermayer

swr: check that the context for swr_convert() has been initialized

Reviewed-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6c6e4dd139159a7dbf1b85f583804b6334ad88c1
---

 libswresample/swresample.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index e11826e..54e06e1 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -742,6 +742,11 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun
     AudioData * in= &s->in;
     AudioData *out= &s->out;
 
+    if (!swr_is_initialized(s)) {
+        av_log(s, AV_LOG_ERROR, "Context has not been initialized\n");
+        return AVERROR(EINVAL);
+    }
+
     while(s->drop_output > 0){
         int ret;
         uint8_t *tmp_arg[SWR_CH_MAX];



More information about the ffmpeg-cvslog mailing list