History

avcodec/svq1enc: Don't add to NULL

It is undefined behavior. Pass a dummy buffer instead. Fixes "runtime error: applying non-zero offset 1024 to null pointer". affected the SVQ1 vsynth FATE tests.

Andreas Rheinhardt committed 1 year ago

Commit d76ae081 parent 02c16b41 file · +2 −2Browse files

Unified · Split

libavcodec/svq1enc.c+2−2
@@ -444,8 +444,8 @@ static int svq1_encode_plane(SVQ1EncContext *s, int plane, · 443 unmodified lines
444 put_bits(&s->reorder_pb[5], SVQ1_BLOCK_INTRA_LEN, SVQ1_BLOCK_INTRA_CODE);444 put_bits(&s->reorder_pb[5], SVQ1_BLOCK_INTRA_LEN, SVQ1_BLOCK_INTRA_CODE);
445 score[0] = SVQ1_BLOCK_INTRA_LEN * lambda;445 score[0] = SVQ1_BLOCK_INTRA_LEN * lambda;
446 }446 }
447 score[0] += encode_block(s, src + 16 * x, NULL, temp, stride,447 score[0] += encode_block(s, src + 16 * x, src + 16 * x /* unused */,
448 5, 64, lambda, 1);448 temp, stride, 5, 64, lambda, 1);
449 for (i = 0; i < 6; i++) {449 for (i = 0; i < 6; i++) {
450 count[0][i] = put_bits_count(&s->reorder_pb[i]);450 count[0][i] = put_bits_count(&s->reorder_pb[i]);
451 flush_put_bits(&s->reorder_pb[i]);451 flush_put_bits(&s->reorder_pb[i]);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t