Merge commit '859ce02c9815b492da627d3098548b4f69bbc80e' into release/2.4
* commit '859ce02c9815b492da627d3098548b4f69bbc80e':
h263: Always check both dimensions
Conflicts:
libavcodec/ituh263dec.c
See: 62006b539d
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "libavutil/attributes.h"
|
#include "libavutil/attributes.h"
|
||||||
|
#include "libavutil/imgutils.h"
|
||||||
#include "libavutil/internal.h"
|
#include "libavutil/internal.h"
|
||||||
#include "libavutil/mathematics.h"
|
#include "libavutil/mathematics.h"
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
@@ -872,7 +873,7 @@ end:
|
|||||||
/* most is hardcoded. should extend to handle all h263 streams */
|
/* most is hardcoded. should extend to handle all h263 streams */
|
||||||
int ff_h263_decode_picture_header(MpegEncContext *s)
|
int ff_h263_decode_picture_header(MpegEncContext *s)
|
||||||
{
|
{
|
||||||
int format, width, height, i;
|
int format, width, height, i, ret;
|
||||||
uint32_t startcode;
|
uint32_t startcode;
|
||||||
|
|
||||||
align_get_bits(&s->gb);
|
align_get_bits(&s->gb);
|
||||||
@@ -927,8 +928,6 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
|
|||||||
/* H.263v1 */
|
/* H.263v1 */
|
||||||
width = ff_h263_format[format][0];
|
width = ff_h263_format[format][0];
|
||||||
height = ff_h263_format[format][1];
|
height = ff_h263_format[format][1];
|
||||||
if (!width)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb);
|
s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb);
|
||||||
|
|
||||||
@@ -1084,10 +1083,9 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
|
|||||||
s->qscale = get_bits(&s->gb, 5);
|
s->qscale = get_bits(&s->gb, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->width == 0 || s->height == 0) {
|
if ((ret = av_image_check_size(s->width, s->height, 0, s)) < 0)
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "dimensions 0\n");
|
return ret;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
s->mb_width = (s->width + 15) / 16;
|
s->mb_width = (s->width + 15) / 16;
|
||||||
s->mb_height = (s->height + 15) / 16;
|
s->mb_height = (s->height + 15) / 16;
|
||||||
s->mb_num = s->mb_width * s->mb_height;
|
s->mb_num = s->mb_width * s->mb_height;
|
||||||
|
Reference in New Issue
Block a user