On 10/27/2013 06:10 AM, Anton Khirnov wrote:
---
  libavcodec/vp5.c  |    4 +++-
  libavcodec/vp56.c |    4 ++--
  libavcodec/vp6.c  |    7 +++++--
  3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c
index f4d1c7f..5cab9b6 100644
--- a/libavcodec/vp5.c
+++ b/libavcodec/vp5.c
@@ -67,7 +67,9 @@ static int vp5_parse_header(VP56Context *s, const uint8_t 
*buf, int buf_size,
          if (!s->macroblocks || /* first frame */
              16*cols != s->avctx->coded_width ||
              16*rows != s->avctx->coded_height) {
-            avcodec_set_dimensions(s->avctx, 16*cols, 16*rows);
+            int ret = ff_set_dimensions(s->avctx, 16 * cols, 16 * rows);
+            if (ret < 0)
+                return ret;
              return VP56_SIZE_CHANGE;
          }
      } else if (!s->macroblocks)
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 35df0e0..53a0271 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -470,7 +470,7 @@ static int vp56_size_changed(AVCodecContext *avctx)
      s->mb_height = (avctx->coded_height+15) / 16;
if (s->mb_width > 1000 || s->mb_height > 1000) {
-        avcodec_set_dimensions(avctx, 0, 0);
+        ff_set_dimensions(avctx, 0, 0);
          av_log(avctx, AV_LOG_ERROR, "picture too big\n");
          return -1;
      }
@@ -528,7 +528,7 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
              for (i = 0; i < 4; i++)
                  av_frame_unref(s->frames[i]);
              if (is_alpha) {
-                avcodec_set_dimensions(avctx, 0, 0);
+                ff_set_dimensions(avctx, 0, 0);
                  return -1;
              }
          }
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index fddfc9d..07560d0 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -93,7 +93,10 @@ static int vp6_parse_header(VP56Context *s, const uint8_t 
*buf, int buf_size,
                  s->avctx->coded_width  = 16 * cols;
                  s->avctx->coded_height = 16 * rows;
              } else {
-                avcodec_set_dimensions(s->avctx, 16 * cols, 16 * rows);
+                int ret = ff_set_dimensions(s->avctx, 16 * cols, 16 * rows);
+                if (ret < 0)
+                    return ret;
+
                  if (s->avctx->extradata_size == 1) {
                      s->avctx->width  -= s->avctx->extradata[0] >> 4;
                      s->avctx->height -= s->avctx->extradata[0] & 0x0F;
@@ -154,7 +157,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t 
*buf, int buf_size,
          buf_size -= coeff_offset;
          if (buf_size < 0) {
              if (s->frames[VP56_FRAME_CURRENT]->key_frame)
-                avcodec_set_dimensions(s->avctx, 0, 0);
+                ff_set_dimensions(s->avctx, 0, 0);
              return AVERROR_INVALIDDATA;
          }
          if (s->use_huffman) {

Ok

-Justin

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to