summaryrefslogtreecommitdiffstats
path: root/libswresample
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-22 22:29:51 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-24 08:23:42 +0100
commit6c6e4dd139159a7dbf1b85f583804b6334ad88c1 (patch)
tree50f4675ab3cf3c0f76e695ac87c88b46104e543f /libswresample
parenta66be608883d54fc0970a8b43f4a51a359e664ee (diff)
downloadffmpeg-streaming-6c6e4dd139159a7dbf1b85f583804b6334ad88c1.zip
ffmpeg-streaming-6c6e4dd139159a7dbf1b85f583804b6334ad88c1.tar.gz
swr: check that the context for swr_convert() has been initialized
Reviewed-by: ubitux Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswresample')
-rw-r--r--libswresample/swresample.c5
1 files changed, 5 insertions, 0 deletions
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];
OpenPOWER on IntegriCloud