| OLD | NEW |
| 1 /* | 1 /* |
| 2 * H.26L/H.264/AVC/JVT/14496-10/... parameter set decoding | 2 * H.26L/H.264/AVC/JVT/14496-10/... parameter set decoding |
| 3 * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at> | 3 * Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at> |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 335 |
| 336 sps->ref_frame_count= get_ue_golomb_31(&s->gb); | 336 sps->ref_frame_count= get_ue_golomb_31(&s->gb); |
| 337 if(sps->ref_frame_count > MAX_PICTURE_COUNT-2 || sps->ref_frame_count >= 32U
){ | 337 if(sps->ref_frame_count > MAX_PICTURE_COUNT-2 || sps->ref_frame_count >= 32U
){ |
| 338 av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n"); | 338 av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n"); |
| 339 goto fail; | 339 goto fail; |
| 340 } | 340 } |
| 341 sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb); | 341 sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb); |
| 342 sps->mb_width = get_ue_golomb(&s->gb) + 1; | 342 sps->mb_width = get_ue_golomb(&s->gb) + 1; |
| 343 sps->mb_height= get_ue_golomb(&s->gb) + 1; | 343 sps->mb_height= get_ue_golomb(&s->gb) + 1; |
| 344 if((unsigned)sps->mb_width >= INT_MAX/16 || (unsigned)sps->mb_height >= INT_
MAX/16 || | 344 if((unsigned)sps->mb_width >= INT_MAX/16 || (unsigned)sps->mb_height >= INT_
MAX/16 || |
| 345 av_check_image_size(16*sps->mb_width, 16*sps->mb_height, 0, h->s.avctx)){ | 345 av_image_check_size(16*sps->mb_width, 16*sps->mb_height, 0, h->s.avctx)){ |
| 346 av_log(h->s.avctx, AV_LOG_ERROR, "mb_width/height overflow\n"); | 346 av_log(h->s.avctx, AV_LOG_ERROR, "mb_width/height overflow\n"); |
| 347 goto fail; | 347 goto fail; |
| 348 } | 348 } |
| 349 | 349 |
| 350 sps->frame_mbs_only_flag= get_bits1(&s->gb); | 350 sps->frame_mbs_only_flag= get_bits1(&s->gb); |
| 351 if(!sps->frame_mbs_only_flag) | 351 if(!sps->frame_mbs_only_flag) |
| 352 sps->mb_aff= get_bits1(&s->gb); | 352 sps->mb_aff= get_bits1(&s->gb); |
| 353 else | 353 else |
| 354 sps->mb_aff= 0; | 354 sps->mb_aff= 0; |
| 355 | 355 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 ); | 529 ); |
| 530 } | 530 } |
| 531 | 531 |
| 532 av_free(h->pps_buffers[pps_id]); | 532 av_free(h->pps_buffers[pps_id]); |
| 533 h->pps_buffers[pps_id]= pps; | 533 h->pps_buffers[pps_id]= pps; |
| 534 return 0; | 534 return 0; |
| 535 fail: | 535 fail: |
| 536 av_free(pps); | 536 av_free(pps); |
| 537 return -1; | 537 return -1; |
| 538 } | 538 } |
| OLD | NEW |