Merge commit 'e2ad0b66fa273c5c823978e8f601f2c0d9ee42f8'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Jan 2015 03:56:32 +0000 (04:56 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 15 Jan 2015 04:07:25 +0000 (05:07 +0100)
* commit 'e2ad0b66fa273c5c823978e8f601f2c0d9ee42f8':
  imgutils: create misc functions for dealing with buffers

Conflicts:
doc/APIchanges
libavcodec/avcodec.h
libavcodec/avpicture.c
libavutil/imgutils.c
libavutil/imgutils.h
libavutil/version.h

See: e6674e46ecdd7aaa93d7f7d818eb1c8224b35eae
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavutil/imgutils.c
libavutil/imgutils.h
libavutil/version.h

@@@ -331,23 -317,29 +333,29 @@@ int av_image_fill_arrays(uint8_t *dst_d
      for (i = 0; i < 4; i++)
          dst_linesize[i] = FFALIGN(dst_linesize[i], align);
  
 -    return av_image_fill_pointers(dst_data, pix_fmt, height, src, dst_linesize);
 +    return av_image_fill_pointers(dst_data, pix_fmt, height, (uint8_t *)src, dst_linesize);
  }
  
- int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
+ int av_image_get_buffer_size(enum AVPixelFormat pix_fmt,
+                              int width, int height, int align)
  {
-     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
      uint8_t *data[4];
      int linesize[4];
+     int ret;
+     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
      if (!desc)
 -        return AVERROR_BUG;
 +        return AVERROR(EINVAL);
-     if (av_image_check_size(width, height, 0, NULL) < 0)
-         return AVERROR(EINVAL);
+     ret = av_image_check_size(width, height, 0, NULL);
+     if (ret < 0)
+         return ret;
+     // do not include palette for these pseudo-paletted formats
      if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
-         // do not include palette for these pseudo-paletted formats
          return width * height;
-     return av_image_fill_arrays(data, linesize, NULL, pix_fmt, width, height, align);
+     return av_image_fill_arrays(data, linesize, NULL, pix_fmt,
+                                 width, height, align);
  }
  
  int av_image_copy_to_buffer(uint8_t *dst, int dst_size,
Simple merge
@@@ -55,9 -53,9 +55,9 @@@
   * @{
   */
  
 -#define LIBAVUTIL_VERSION_MAJOR 54
 -#define LIBAVUTIL_VERSION_MINOR  6
 -#define LIBAVUTIL_VERSION_MICRO  0
 +#define LIBAVUTIL_VERSION_MAJOR  54
 +#define LIBAVUTIL_VERSION_MINOR  16
- #define LIBAVUTIL_VERSION_MICRO 100
++#define LIBAVUTIL_VERSION_MICRO 101
  
  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                 LIBAVUTIL_VERSION_MINOR, \