changeset 12489:8cd356429e9f libavcodec

Test lowres before codec init.
author cehoyos
date Mon, 13 Sep 2010 22:03:29 +0000
parents 351a81a23343
children e1a4ceb96a07
files utils.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Sat Sep 11 19:52:09 2010 +0000
+++ b/utils.c	Mon Sep 13 22:03:29 2010 +0000
@@ -504,13 +504,13 @@
         goto free_and_end;
     }
     avctx->frame_number = 0;
+    if (avctx->codec->max_lowres < avctx->lowres) {
+        av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
+               avctx->codec->max_lowres);
+        goto free_and_end;
+    }
+
     if(avctx->codec->init){
-        if (avctx->codec->max_lowres < avctx->lowres) {
-            av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
-                   avctx->codec->max_lowres);
-            goto free_and_end;
-        }
-
         ret = avctx->codec->init(avctx);
         if (ret < 0) {
             goto free_and_end;