OSDN Git Service

Merge commit 'b0eeb9d442e4b7e82f6797d74245434ea33110a5'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Jul 2013 11:18:07 +0000 (13:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Jul 2013 11:18:29 +0000 (13:18 +0200)
* commit 'b0eeb9d442e4b7e82f6797d74245434ea33110a5':
  indeo5: return proper error codes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/indeo5.c

@@@ -81,11 -81,11 +81,11 @@@ static int decode_gop_header(IVI45DecCo
      /* num_levels * 3 + 1 */
      pic_conf.luma_bands   = get_bits(&ctx->gb, 2) * 3 + 1;
      pic_conf.chroma_bands = get_bits1(&ctx->gb)   * 3 + 1;
 -    ctx->is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1;
 -    if (ctx->is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) {
 +    is_scalable = pic_conf.luma_bands != 1 || pic_conf.chroma_bands != 1;
 +    if (is_scalable && (pic_conf.luma_bands != 4 || pic_conf.chroma_bands != 1)) {
          av_log(avctx, AV_LOG_ERROR, "Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n",
                 pic_conf.luma_bands, pic_conf.chroma_bands);
-         return -1;
+         return AVERROR_INVALIDDATA;
      }
  
      pic_size_indx = get_bits(&ctx->gb, 4);
      /* check if picture layout was changed and reallocate buffers */
      if (ivi_pic_config_cmp(&pic_conf, &ctx->pic_conf)) {
          result = ff_ivi_init_planes(ctx->planes, &pic_conf);
-         if (result) {
+         if (result < 0) {
              av_log(avctx, AV_LOG_ERROR, "Couldn't reallocate color planes!\n");
-             return -1;
+             return result;
          }
          ctx->pic_conf = pic_conf;
 +        ctx->is_scalable = is_scalable;
          blk_size_changed = 1; /* force reallocation of the internal structures */
      }