Skip to content

Commit 077b9e1

Browse files
committed
Обновлен ffmpeg n8.2-dev-1407-g80405d3ceb.
1 parent d746bad commit 077b9e1

15 files changed

Lines changed: 135 additions & 142 deletions

docs/Changelog.Rus.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ YouTube
7878

7979
Обновлены библиотеки:
8080
dav1d 1.5.3-6-g04b69f9;
81-
ffmpeg n8.2-dev-1322-g4492ad7228;
81+
ffmpeg n8.2-dev-1407-g80405d3ceb;
8282
libpng git-v1.6.55-9-g7d52a8087;
8383
Little-CMS git-lcms2.18-26-gf739cda;
8484
MediaInfo git-v26.05-38-g702c9b7fd;

docs/Changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Updated Korean translation (by Hackjjang).
7878

7979
Updated libraries:
8080
dav1d 1.5.3-6-g04b69f9;
81-
ffmpeg n8.2-dev-1322-g4492ad7228;
81+
ffmpeg n8.2-dev-1407-g80405d3ceb;
8282
libpng git-v1.6.55-9-g7d52a8087;
8383
Little-CMS git-lcms2.18-26-gf739cda;
8484
MediaInfo git-v26.05-38-g702c9b7fd;

src/ExtLib/ffmpeg/libavcodec/atrac9dec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ static int atrac9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
817817

818818
*got_frame_ptr = 1;
819819

820-
return avctx->block_align;
820+
return frames < s->frame_count ? (get_bits_count(&gb) >> 3) : avctx->block_align;
821821
}
822822

823823
static av_cold void atrac9_decode_flush(AVCodecContext *avctx)

src/ExtLib/ffmpeg/libavcodec/h264_slice.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,10 @@ static void color_frame(AVFrame *frame, const int c[4])
316316
int bytes = is_chroma ? AV_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width;
317317
int height = is_chroma ? AV_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height;
318318
if (desc->comp[0].depth >= 9) {
319-
((uint16_t*)dst)[0] = c[p];
320-
av_memcpy_backptr(dst + 2, 2, bytes - 2);
319+
if (bytes >= 1)
320+
((uint16_t*)dst)[0] = c[p];
321+
if (bytes >= 2)
322+
av_memcpy_backptr(dst + 2, 2, 2 * (bytes - 1));
321323
dst += frame->linesize[p];
322324
for (int y = 1; y < height; y++) {
323325
memcpy(dst, frame->data[p], 2*bytes);

src/ExtLib/ffmpeg/libavcodec/jpeg2000dec.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,8 +2451,14 @@ static void jpeg2000_dec_cleanup(Jpeg2000DecoderContext *s)
24512451
memset(s->qntsty, 0, sizeof(s->qntsty));
24522452
memset(s->properties, 0, sizeof(s->properties));
24532453
memset(&s->poc , 0, sizeof(s->poc));
2454+
memset(s->roi_shift, 0, sizeof(s->roi_shift));
24542455
s->numXtiles = s->numYtiles = 0;
24552456
s->ncomponents = 0;
2457+
s->has_ppm = 0;
2458+
s->isHT = 0;
2459+
s->precision = 0;
2460+
s->colour_space = 0;
2461+
s->pal8 = 0;
24562462
}
24572463

24582464
static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)

src/ExtLib/ffmpeg/libavcodec/libfdk-aacdec.c

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,18 @@ static int get_stream_info(AVCodecContext *avctx, AVFrame *frame)
159159
channel_counts[ACT_BACK_TOP] + channel_counts[ACT_TOP]);
160160

161161
switch (channel_counts[ACT_FRONT]) {
162+
case 5:
162163
case 4:
163-
ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_LEFT_OF_CENTER |
164+
ch_layout |= AV_CH_FRONT_LEFT_OF_CENTER |
164165
AV_CH_FRONT_RIGHT_OF_CENTER;
165-
break;
166+
av_fallthrough;
166167
case 3:
167-
ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER;
168-
break;
169168
case 2:
170169
ch_layout |= AV_CH_LAYOUT_STEREO;
171-
break;
170+
av_fallthrough;
172171
case 1:
173-
ch_layout |= AV_CH_FRONT_CENTER;
172+
if (channel_counts[ACT_FRONT] & 1)
173+
ch_layout |= AV_CH_FRONT_CENTER;
174174
break;
175175
default:
176176
av_log(avctx, AV_LOG_WARNING,
@@ -179,6 +179,7 @@ static int get_stream_info(AVCodecContext *avctx, AVFrame *frame)
179179
ch_error = 1;
180180
break;
181181
}
182+
182183
if (channel_counts[ACT_SIDE] > 0) {
183184
if (channel_counts[ACT_SIDE] == 2) {
184185
ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT;
@@ -192,16 +193,15 @@ static int get_stream_info(AVCodecContext *avctx, AVFrame *frame)
192193
if (channel_counts[ACT_BACK] > 0) {
193194
switch (channel_counts[ACT_BACK]) {
194195
case 4:
195-
ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT;
196-
break;
196+
ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT;
197+
av_fallthrough;
197198
case 3:
198-
ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_BACK_CENTER;
199-
break;
200199
case 2:
201200
ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT;
202-
break;
201+
av_fallthrough;
203202
case 1:
204-
ch_layout |= AV_CH_BACK_CENTER;
203+
if (channel_counts[ACT_BACK] & 1)
204+
ch_layout |= AV_CH_BACK_CENTER;
205205
break;
206206
default:
207207
av_log(avctx, AV_LOG_WARNING,
@@ -224,14 +224,12 @@ static int get_stream_info(AVCodecContext *avctx, AVFrame *frame)
224224
if (channel_counts[ACT_FRONT_TOP] > 0) {
225225
switch (channel_counts[ACT_FRONT_TOP]) {
226226
case 3:
227-
ch_layout |= AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT |
228-
AV_CH_TOP_FRONT_CENTER;
229-
break;
230227
case 2:
231228
ch_layout |= AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT;
232-
break;
229+
av_fallthrough;
233230
case 1:
234-
ch_layout |= AV_CH_TOP_FRONT_CENTER;
231+
if (channel_counts[ACT_FRONT_TOP] & 1)
232+
ch_layout |= AV_CH_TOP_FRONT_CENTER;
235233
break;
236234
default:
237235
av_log(avctx, AV_LOG_WARNING,

src/ExtLib/ffmpeg/libavcodec/magicyuv.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ static int magy_decode_slice10(AVCodecContext *avctx, void *tdata,
225225
s->llviddsp.add_left_pred_int16(dst, dst, max, width, 0);
226226
dst += stride;
227227
}
228-
lefttop = left = dst[0];
228+
if (1 + interlaced < height)
229+
lefttop = left = dst[0];
229230
for (k = 1 + interlaced; k < height; k++) {
230231
magicyuv_median_pred16(dst, dst - fake_stride, dst, width, &left, &lefttop, max);
231232
lefttop = left = dst[0];
@@ -553,6 +554,13 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p,
553554
"invalid slice height: %d\n", s->slice_height);
554555
return AVERROR_INVALIDDATA;
555556
}
557+
if (s->vshift[1] && (s->slice_height & ((1 << s->vshift[1]) - 1))) {
558+
av_log(avctx, AV_LOG_ERROR,
559+
"slice_height %d is not aligned to chroma vertical "
560+
"subsampling (must be a multiple of %d)\n",
561+
s->slice_height, 1 << s->vshift[1]);
562+
return AVERROR_INVALIDDATA;
563+
}
556564

557565
bytestream2_skipu(&gb, 4);
558566

@@ -563,11 +571,11 @@ static int magy_decode_frame(AVCodecContext *avctx, AVFrame *p,
563571
return AVERROR_INVALIDDATA;
564572
}
565573

574+
if ((s->slice_height >> s->vshift[1]) <= s->interlaced) {
575+
av_log(avctx, AV_LOG_ERROR, "impossible slice height\n");
576+
return AVERROR_INVALIDDATA;
577+
}
566578
if (s->interlaced) {
567-
if ((s->slice_height >> s->vshift[1]) < 2) {
568-
av_log(avctx, AV_LOG_ERROR, "impossible slice height\n");
569-
return AVERROR_INVALIDDATA;
570-
}
571579
if ((avctx->coded_height % s->slice_height) && ((avctx->coded_height % s->slice_height) >> s->vshift[1]) < 2) {
572580
av_log(avctx, AV_LOG_ERROR, "impossible height\n");
573581
return AVERROR_INVALIDDATA;

src/ExtLib/ffmpeg/libavcodec/mjpegdec.c

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -426,19 +426,6 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
426426
return AVERROR_PATCHWELCOME;
427427
}
428428

429-
if (s->bayer) {
430-
if (nb_components == 2) {
431-
/* Bayer images embedded in DNGs can contain 2 interleaved components and the
432-
width stored in their SOF3 markers is the width of each one. We only output
433-
a single component, therefore we need to adjust the output image width. We
434-
handle the deinterleaving (but not the debayering) in this file. */
435-
width *= 2;
436-
}
437-
/* They can also contain 1 component, which is double the width and half the height
438-
of the final image (rows are interleaved). We don't handle the decoding in this
439-
file, but leave that to the TIFF/DNG decoder. */
440-
}
441-
442429
/* if different size, realloc/alloc picture */
443430
if (width != s->width || height != s->height || bits != s->bits ||
444431
memcmp(s->h_count, h_count, sizeof(h_count)) ||
@@ -475,6 +462,19 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
475462
s->orig_height < height)
476463
s->avctx->height = AV_CEIL_RSHIFT(s->orig_height, s->avctx->lowres);
477464

465+
if (s->bayer) {
466+
if (nb_components == 2) {
467+
/* Bayer images embedded in DNGs can contain 2 interleaved components and the
468+
* width stored in their SOF3 markers is the width of each one. We only output
469+
* a single component, therefore we need to adjust the output image width. We
470+
* handle the deinterleaving (but not the debayering) in this file. */
471+
s->avctx->width *= 2;
472+
}
473+
/* They can also contain 1 component, which is double the width and half the height
474+
* of the final image (rows are interleaved). We don't handle the decoding in this
475+
* file, but leave that to the TIFF/DNG decoder. */
476+
}
477+
478478
s->first_picture = 0;
479479
} else {
480480
size_change = 0;
@@ -1086,14 +1086,12 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s)
10861086
int predictor = s->Ss;
10871087
int point_transform = s->Al;
10881088
int i, mb_x, mb_y;
1089-
unsigned width;
10901089
uint16_t (*buffer)[4];
10911090
int left[4], top[4], topleft[4];
10921091
const int linesize = s->linesize[0];
10931092
const int mask = ((1 << s->bits) - 1) << point_transform;
10941093
int resync_mb_y = 0;
10951094
int resync_mb_x = 0;
1096-
int vpred[6];
10971095
int ret;
10981096

10991097
if (!s->bayer && s->nb_components < 3)
@@ -1109,16 +1107,8 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s)
11091107
return AVERROR_INVALIDDATA;
11101108
}
11111109

1112-
1113-
for (i = 0; i < 6; i++)
1114-
vpred[i] = 1 << (s->bits - 1);
1115-
1116-
if (s->bayer)
1117-
width = s->mb_width / nb_components; /* Interleaved, width stored is the total so need to divide */
1118-
else
1119-
width = s->mb_width;
1120-
1121-
av_fast_malloc(&s->ljpeg_buffer, &s->ljpeg_buffer_size, width * 4 * sizeof(s->ljpeg_buffer[0][0]));
1110+
av_fast_malloc(&s->ljpeg_buffer, &s->ljpeg_buffer_size,
1111+
(unsigned)s->mb_width * 4 * sizeof(s->ljpeg_buffer[0][0]));
11221112
if (!s->ljpeg_buffer)
11231113
return AVERROR(ENOMEM);
11241114

@@ -1138,7 +1128,7 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s)
11381128
for (i = 0; i < 4; i++)
11391129
top[i] = left[i] = topleft[i] = buffer[0][i];
11401130

1141-
for (mb_x = 0; mb_x < width; mb_x++) {
1131+
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
11421132
int modified_predictor = predictor;
11431133
int restart;
11441134

@@ -1166,19 +1156,12 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s)
11661156
topleft[i] = top[i];
11671157
top[i] = buffer[mb_x][i];
11681158

1159+
PREDICT(pred, topleft[i], top[i], left[i], modified_predictor);
1160+
11691161
ret = mjpeg_decode_dc(s, s->dc_index[i], &dc);
11701162
if (ret < 0)
11711163
return ret;
11721164

1173-
if (!s->bayer || mb_x) {
1174-
pred = left[i];
1175-
} else { /* This path runs only for the first line in bayer images */
1176-
vpred[i] += dc;
1177-
pred = vpred[i] - dc;
1178-
}
1179-
1180-
PREDICT(pred, topleft[i], top[i], pred, modified_predictor);
1181-
11821165
left[i] = buffer[mb_x][i] =
11831166
mask & (pred + (unsigned)(dc * (1 << point_transform)));
11841167
}
@@ -1222,10 +1205,10 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s)
12221205
return AVERROR_PATCHWELCOME;
12231206
if (nb_components == 1) {
12241207
/* Leave decoding to the TIFF/DNG decoder (see comment in ff_mjpeg_decode_sof) */
1225-
for (mb_x = 0; mb_x < width; mb_x++)
1208+
for (mb_x = 0; mb_x < s->mb_width; mb_x++)
12261209
((uint16_t*)ptr)[mb_x] = buffer[mb_x][0];
12271210
} else if (nb_components == 2) {
1228-
for (mb_x = 0; mb_x < width; mb_x++) {
1211+
for (mb_x = 0; mb_x < s->mb_width; mb_x++) {
12291212
((uint16_t*)ptr)[2 * mb_x + 0] = buffer[mb_x][0];
12301213
((uint16_t*)ptr)[2 * mb_x + 1] = buffer[mb_x][1];
12311214
}

src/ExtLib/ffmpeg/libavcodec/pngdec.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ static int png_decode_idat(PNGDecContext *s, GetByteContext *gb,
450450
return 0;
451451
}
452452

453+
/* Hard cap on decompressed zTXt/iCCP payloads to defeat decompression bombs. */
454+
#define PNG_ZBUF_MAX_DECOMPRESSED (16 * 1024 * 1024)
455+
453456
static int decode_zbuf(AVBPrint *bp, const uint8_t *data,
454457
const uint8_t *data_end, void *logctx)
455458
{
@@ -466,6 +469,13 @@ static int decode_zbuf(AVBPrint *bp, const uint8_t *data,
466469
av_bprint_init(bp, 0, AV_BPRINT_SIZE_UNLIMITED);
467470

468471
while (zstream->avail_in > 0) {
472+
if (bp->len > PNG_ZBUF_MAX_DECOMPRESSED) {
473+
av_log(logctx, AV_LOG_ERROR,
474+
"Compressed PNG chunk expands beyond %d bytes, aborting\n",
475+
PNG_ZBUF_MAX_DECOMPRESSED);
476+
ret = AVERROR_INVALIDDATA;
477+
goto fail;
478+
}
469479
av_bprint_get_buffer(bp, 2, &buf, &buf_size);
470480
if (buf_size < 2) {
471481
ret = AVERROR(ENOMEM);

src/ExtLib/ffmpeg/libavcodec/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "version_major.h"
3131

3232
#define LIBAVCODEC_VERSION_MINOR 34
33-
#define LIBAVCODEC_VERSION_MICRO 101
33+
#define LIBAVCODEC_VERSION_MICRO 102
3434

3535
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636
LIBAVCODEC_VERSION_MINOR, \

0 commit comments

Comments
 (0)