Merge commit '86e1a35802df42f51337d3fed8d5d99d0898c8bf'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 20 Apr 2015 20:49:50 +0000 (22:49 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 20 Apr 2015 20:49:50 +0000 (22:49 +0200)
* commit '86e1a35802df42f51337d3fed8d5d99d0898c8bf':
  h264_ps: Return meaningful error codes and address a memory leak

Conflicts:
libavcodec/h264_ps.c

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

@@@ -609,15 -568,12 +611,17 @@@ int ff_h264_decode_picture_parameter_se
          goto fail;
      }
      sps = h->sps_buffers[pps->sps_id];
 -
 -    if (sps->bit_depth_luma > 10) {
 +    if (sps->bit_depth_luma > 14) {
 +        av_log(h->avctx, AV_LOG_ERROR,
 +               "Invalid luma bit depth=%d\n",
 +               sps->bit_depth_luma);
++        ret = AVERROR_INVALIDDATA;
 +        goto fail;
 +    } else if (sps->bit_depth_luma == 11 || sps->bit_depth_luma == 13) {
          av_log(h->avctx, AV_LOG_ERROR,
 -               "Unimplemented luma bit depth=%d (max=10)\n",
 +               "Unimplemented luma bit depth=%d\n",
                 sps->bit_depth_luma);
+         ret = AVERROR_PATCHWELCOME;
          goto fail;
      }